PuzzleSDK
DurationRecorder类 参考

Public 成员函数

void startTick (const std::string &key)
 
int endTick (const std::string &key)
 
int64_t now () const
 
void reset ()
 

Private 属性

std::map< std::string, int64_t > _durations
 

详细描述

在文件 NewRendererTest.cpp33 行定义.

成员函数说明

◆ endTick()

int DurationRecorder::endTick ( const std::string &  key)
inline

在文件 NewRendererTest.cpp39 行定义.

39 {
40 auto n = now();
41 auto itr = _durations.find(key);
42 if(_durations.find(key) == _durations.end())
43 {
44 return -1;
45 }
46 else if(itr->second < 0) {
47 itr->second = n + itr->second;
48 }
49 return static_cast<int>(itr->second);
50 }
int64_t now() const
std::map< std::string, int64_t > _durations

引用了 _durations , 以及 now().

被这些函数引用 SpriteCreation::doTest().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ now()

int64_t DurationRecorder::now ( ) const
inline

在文件 NewRendererTest.cpp52 行定义.

52 {
53 return std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
54 }

被这些函数引用 endTick() , 以及 startTick().

+ 这是这个函数的调用关系图:

◆ reset()

void DurationRecorder::reset ( )
inline

在文件 NewRendererTest.cpp56 行定义.

56 {
57 _durations.clear();
58 }

引用了 _durations.

◆ startTick()

void DurationRecorder::startTick ( const std::string &  key)
inline

在文件 NewRendererTest.cpp35 行定义.

35 {
36 _durations[key] = - now();
37 }

引用了 _durations , 以及 now().

被这些函数引用 SpriteCreation::doTest().

+ 函数调用图:
+ 这是这个函数的调用关系图:

类成员变量说明

◆ _durations

std::map<std::string, int64_t > DurationRecorder::_durations
private

在文件 NewRendererTest.cpp61 行定义.

被这些函数引用 endTick(), reset() , 以及 startTick().


该类的文档由以下文件生成: