ZFFramework
Loading...
Searching...
No Matches
ZFCoreStatistic_ZFTime.h
Go to the documentation of this file.
1
5
6#ifndef _ZFI_ZFCoreStatistic_ZFTime_h_
7#define _ZFI_ZFCoreStatistic_ZFTime_h_
8
9#include "ZFTime.h"
12
13// ============================================================
36ZFMETHOD_FUNC_DECLARE_1(ZFLIB_ZFCore, void, invokeTimeLogBegin
37 , ZFMP_IN(const zfstring &, key)
38 )
41 , ZFMP_IN(const zfstring &, key)
42 )
45 , ZFMP_IN(const zfstring &, key)
46 )
51 , ZFMP_IN(const zfstring &, key)
52 )
55 , ZFMP_IN(const zfstring &, key)
56 )
59 , ZFMP_IN(const zfstring &, key)
60 )
63 , ZFMP_OUT(zfstring &, ret)
64 , ZFMP_IN(const zfstring &, key)
65 )
68 , ZFMP_IN(const zfstring &, key)
69 )
70
73
74// ============================================================
75zfclassLikePOD ZFLIB_ZFCore _ZFP_ZFCoreStatisticInvokeTimeLogger {
76public:
77 _ZFP_ZFCoreStatisticInvokeTimeLogger(ZF_IN const zfstring &key)
78 : key(key)
79 {
81 }
82 ~_ZFP_ZFCoreStatisticInvokeTimeLogger(void) {
84 }
85private:
86 zfstring key;
87};
89#define ZFCoreStatisticInvokeTimeLogger(key) \
90 ZFCoreStatistic::_ZFP_ZFCoreStatisticInvokeTimeLogger ZFUniqueName(ZFCoreStatisticInvokeTimeLogger_v)(key)
91
92// ============================================================
93zfclassLikePOD ZFLIB_ZFCore _ZFP_ZFCoreStatisticInvokeTimeLoggerOneTime {
94public:
95 _ZFP_ZFCoreStatisticInvokeTimeLoggerOneTime(
96 ZF_IN const zfstring &key
97 , ZF_IN const ZFOutput &output = ZFOutputDefault()
98 )
99 : key(key)
100 , output(output)
101 {
103 }
104 ~_ZFP_ZFCoreStatisticInvokeTimeLoggerOneTime(void) {
106 output << ZFCoreStatistic::invokeTimeGetSummary(key) << "\n";
108 }
109private:
110 zfstring key;
111 ZFOutput output;
112};
114#define ZFCoreStatisticInvokeTimeLoggerOneTime(key, ...) \
115 ZFCoreStatistic::_ZFP_ZFCoreStatisticInvokeTimeLoggerOneTime \
116 ZFUniqueName(ZFCoreStatisticInvokeTimeLoggerOneTime_v)(key, ##__VA_ARGS__)
117
120#endif // #ifndef _ZFI_ZFCoreStatistic_ZFTime_h_
121
#define ZFLIB_ZFCore
used to export symbols
Definition ZFCoreEnvDef.h:30
#define zfclassLikePOD
shows the class is not a POD type, but you may use it like a POD except memset it to 0
Definition ZFCoreTypeDef_ClassType.h:41
#define ZF_IN
dummy macro that shows the param used as required input
Definition ZFCoreTypeDef_ClassType.h:184
_ZFT_t_zfindex zfindex
similar to size_t, used for index and size only
Definition ZFCoreTypeDef_CoreType.h:154
zft_zfstring< zfchar > zfstring
see zft_zfstring
Definition ZFCoreTypeDef_StringType.h:15
#define ZFMP_OUT(ParamType, paramName)
see ZFMP_IN
Definition ZFMethod.h:111
#define ZFMP_IN(ParamType, paramName)
macro to wrap param types for ZFMETHOD_INLINE_0 series
Definition ZFMethod.h:105
#define ZFMETHOD_FUNC_DECLARE_2(ZFLIB_, ReturnType, MethodName, ZFMP_0, ZFMP_1)
see ZFMETHOD_FUNC_DECLARE_0
Definition ZFMethodFuncDeclare.h:763
#define ZFMETHOD_FUNC_DECLARE_0(ZFLIB_, ReturnType, MethodName)
declare function type of ZFMethod
Definition ZFMethodFuncDeclare.h:493
#define ZFMETHOD_FUNC_DECLARE_1(ZFLIB_, ReturnType, MethodName, ZFMP_0)
see ZFMETHOD_FUNC_DECLARE_0
Definition ZFMethodFuncDeclare.h:624
#define ZF_NAMESPACE_GLOBAL_BEGIN
begin namespace ZFFramework
Definition ZFNamespace.h:97
#define ZF_NAMESPACE_END(NameSpace)
end namespace
Definition ZFNamespace.h:60
#define ZF_NAMESPACE_GLOBAL_END
end namespace ZFFramework
Definition ZFNamespace.h:98
#define ZF_NAMESPACE_BEGIN(NameSpace)
begin namespace
Definition ZFNamespace.h:40
const ZFOutput & ZFOutputDefault(void)
default output callback, output source must be zfchar *string
time utility
light weight array
Definition ZFCoreArray.h:344
general output callback
Definition ZFIOCallback_output.h:37
store a time value
Definition ZFTime.h:17
Definition ZFCoreStatistic.h:12
void invokeTimeRemoveAll()
see ZFCoreStatistic::invokeTimeLogBegin
void invokeTimeLogEnd(const zfstring &key)
see ZFCoreStatistic::invokeTimeLogBegin
zfstring invokeTimeGetSummary(const zfstring &key)
see ZFCoreStatistic::invokeTimeLogBegin
ZFCoreArray< zfstring > invokeTimeGetAllKey()
see ZFCoreStatistic::invokeTimeLogBegin
void invokeTimeRemove(const zfstring &key)
see ZFCoreStatistic::invokeTimeLogBegin
ZFTimeValue invokeTimeGetTotalTime(const zfstring &key)
see ZFCoreStatistic::invokeTimeLogBegin
zfindex invokeTimeGetInvokeCount(const zfstring &key)
see ZFCoreStatistic::invokeTimeLogBegin
ZFTimeValue invokeTimeGetAverageTime(const zfstring &key)
see ZFCoreStatistic::invokeTimeLogBegin
void invokeTimeGetSummaryT(zfstring &ret, const zfstring &key)
see ZFCoreStatistic::invokeTimeLogBegin
void invokeTimeLogBegin(const zfstring &key)
util to log function's invoke time