ADTF  3.18.2
cpuusage.h
Go to the documentation of this file.
1 
7 #ifndef _CPU_USAGE_CLASS_HEADER_
8 #define _CPU_USAGE_CLASS_HEADER_
9 
10 namespace A_UTILS_NS
11 {
16 class cCPUUsage
17 {
18  private:
19 #ifdef WIN32
20  tUInt64 nLastSysIdle, nLastSysKernel, nLastSysUser;
21  tUInt64 nLastProcKernel, nLastProcUser;
22  tHandle hSelf;
23 #else
24  tUInt64 nLastSysUser, nLastSysUserNice, nLastSysKernel, nLastSysIdle;
25  clock_t nLastProcTotal, nLastProcKernel, nLastProcUser;
26 #endif
27 
28  public:
29  cCPUUsage();
30  virtual ~cCPUUsage();
31 
38 
47  tVoid GetCurrent(tFloat64& fUsagePercentTotal, tFloat64& fUsagePercentByMe);
48 };
49 
50 } // namespace A_UTILS_NS
51 
52 #endif // _CPU_USAGE_CLASS_HEADER_
void tVoid
The tVoid is always the definition for the void (non-type).
tVoid * tHandle
type definition for a handle value (platform and compiler dependent type).
double tFloat64
type definition for Float64 (64bit double values) (platform and compiler independent type).
uint64_t tUInt64
type definition for unsigned integer values (64bit) (platform and compiler independent type).
This helper classes can be used to determine the current CPU usage.
Definition: cpuusage.h:17
tVoid Init()
Initializer for CPU usage calculations.
tVoid GetCurrent(tFloat64 &fUsagePercentTotal, tFloat64 &fUsagePercentByMe)
Getter for the current CPU usage.
ADTF A_UTIL Namespace - Within adtf this is used as adtf::util or adtf_util.
Definition: d_ptr.h:11