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_IN_OUT(zfstring &, ret)
64 , ZFMP_IN(const zfstring &, key)
65 )
68 , ZFMP_IN(const zfstring &, key)
69 )
70
73
76 , ZFMP_IN_OUT(zfstring &, ret)
77 )
80
81// ============================================================
82zfclassLikePOD ZFLIB_ZFCore _ZFP_ZFCoreStatisticInvokeTimeLogger {
83public:
84 _ZFP_ZFCoreStatisticInvokeTimeLogger(ZF_IN const zfstring &key)
85 : key(key)
86 {
88 }
89 ~_ZFP_ZFCoreStatisticInvokeTimeLogger(void) {
91 }
92private:
93 zfstring key;
94};
96#define ZFCoreStatisticInvokeTimeLogger(key) \
97 ZFCoreStatistic::_ZFP_ZFCoreStatisticInvokeTimeLogger ZFUniqueName(ZFCoreStatisticInvokeTimeLogger_v)(key)
98
99// ============================================================
100zfclassLikePOD ZFLIB_ZFCore _ZFP_ZFCoreStatisticInvokeTimeLoggerOneTime {
101public:
102 _ZFP_ZFCoreStatisticInvokeTimeLoggerOneTime(
103 ZF_IN const zfstring &key
104 , ZF_IN const ZFOutput &output = ZFOutputDefault()
105 )
106 : key(key)
107 , output(output)
108 {
110 }
111 ~_ZFP_ZFCoreStatisticInvokeTimeLoggerOneTime(void) {
113 output << ZFCoreStatistic::invokeTimeGetSummary(key) << "\n";
115 }
116private:
117 zfstring key;
118 ZFOutput output;
119};
121#define ZFCoreStatisticInvokeTimeLoggerOneTime(key, ...) \
122 ZFCoreStatistic::_ZFP_ZFCoreStatisticInvokeTimeLoggerOneTime \
123 ZFUniqueName(ZFCoreStatisticInvokeTimeLoggerOneTime_v)(key, ##__VA_ARGS__)
124
127#endif // #ifndef _ZFI_ZFCoreStatistic_ZFTime_h_
128
#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:196
_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_IN_OUT(ParamType, paramName)
see ZFMP_IN
Definition ZFMethod.h:117
#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:292
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
zfstring invokeTimeGetAllSummary()
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 invokeTimeGetAllSummaryT(zfstring &ret)
see ZFCoreStatistic::invokeTimeLogBegin
void invokeTimeLogBegin(const zfstring &key)
util to log function's invoke time