ZFFramework
 
Loading...
Searching...
No Matches
ZFCoreStatistic Namespace Reference


More...

Classes

class  _ZFP_ZFCoreStatisticInvokeTimeLogger
 
class  _ZFP_ZFCoreStatisticInvokeTimeLoggerOneTime
 

Functions

void invokeCountLog (const zfstring &key)
 see ZFCoreStatistic::invokeCountGet
 
void invokeCountRemove (const zfstring &key)
 see ZFCoreStatistic::invokeCountGet
 
void invokeCountRemoveAll (void)
 see ZFCoreStatistic::invokeCountGet
 
zfindex invokeCountGet (const zfstring &key)
 get ZFCoreStatistic::invokeCountLog's invoke count
 
void invokeTimeLogBegin (const zfstring &key)
 util to log function's invoke time
 
void invokeTimeLogEnd (const zfstring &key)
 see ZFCoreStatistic::invokeTimeLogBegin
 
void invokeTimeRemove (const zfstring &key)
 see ZFCoreStatistic::invokeTimeLogBegin
 
void invokeTimeRemoveAll (void)
 see ZFCoreStatistic::invokeTimeLogBegin
 
zfindex invokeTimeGetInvokeCount (const zfstring &key)
 see ZFCoreStatistic::invokeTimeLogBegin
 
ZFTimeValue invokeTimeGetAverageTime (const zfstring &key)
 see ZFCoreStatistic::invokeTimeLogBegin
 
ZFTimeValue invokeTimeGetTotalTime (const zfstring &key)
 see ZFCoreStatistic::invokeTimeLogBegin
 
void invokeTimeGetSummary (zfstring &ret, const zfstring &key)
 see ZFCoreStatistic::invokeTimeLogBegin
 
zfstring invokeTimeGetSummary (const zfstring &key)
 see ZFCoreStatistic::invokeTimeLogBegin
 

Detailed Description


Function Documentation

◆ invokeCountGet()

zfindex ZFCoreStatistic::invokeCountGet ( const zfstring & key)
extern

get ZFCoreStatistic::invokeCountLog's invoke count

for debug performance use only, used to log a method's invoke count, usage:

void yourFuncToTest(void) {
}
void YourTestFunc(void) {
// this is yourFuncToTest's invoke times
zfindex yourFuncCalledTime = ZFCoreStatistic::invokeCountGet(yourKeyOrNull);
// if you want to reset it:
ZFCoreStatistic::invokeCountReset(yourKeyOrNull);
}
_ZFT_t_zfindex zfindex
similar to size_t, used for index and size only
Definition ZFCoreTypeDef_CoreType.h:154
zfindex invokeCountGet(const zfstring &key)
get ZFCoreStatistic::invokeCountLog's invoke count
void invokeCountLog(const zfstring &key)
see ZFCoreStatistic::invokeCountGet
Note
this method is not thread-safe

◆ invokeTimeLogBegin()

void ZFCoreStatistic::invokeTimeLogBegin ( const zfstring & key)
extern

util to log function's invoke time

usage:

yourHeavyFunc();
// ...
// you may call any times
// finally, print result, and remove
// or, you may use the convenient macro to log and output for one time
{
ZFCoreStatisticInvokeTimeLoggerOneTime(key, optional_outputCallback);
yourHeavyFunc();
}
#define ZFCoreStatisticInvokeTimeLoggerOneTime(key,...)
see ZFCoreStatistic::invokeTimeLogBegin
Definition ZFCoreStatistic_ZFTime.h:101
#define ZFLogTrim(...)
see ZFLog
Definition ZFLog.h:80
void invokeTimeGetSummary(zfstring &ret, const zfstring &key)
see ZFCoreStatistic::invokeTimeLogBegin
void invokeTimeLogEnd(const zfstring &key)
see ZFCoreStatistic::invokeTimeLogBegin
void invokeTimeRemove(const zfstring &key)
see ZFCoreStatistic::invokeTimeLogBegin
void invokeTimeLogBegin(const zfstring &key)
util to log function's invoke time