14 #include <sys/resource.h> 37 accumulatedRealTime_(0),
38 accumulatedCPUTime_(0) {
39 #ifdef USE_CLOCK_GETTIME 76 #ifdef USE_CLOCK_GETTIME 83 if(0 != getrusage(RUSAGE_SELF, &theUsage)) {
86 startCPUTime_.tv_sec = theUsage.ru_stime.tv_sec + theUsage.ru_utime.tv_sec;
87 startCPUTime_.tv_usec = theUsage.ru_stime.tv_usec + theUsage.ru_utime.tv_usec;
121 #ifdef USE_CLOCK_GETTIME 122 double const nanosecToSec = 1E-9;
132 if(0 != getrusage(RUSAGE_SELF, &theUsage)) {
135 double const microsecToSec = 1E-6;
138 gettimeofday(&tp, 0);
140 returnValue.
cpu_ = theUsage.ru_stime.tv_sec + theUsage.ru_utime.tv_sec -
startCPUTime_.tv_sec +
141 microsecToSec * (theUsage.ru_stime.tv_usec + theUsage.ru_utime.tv_usec -
startCPUTime_.tv_usec);
enum edm::CPUTimer::State state_
struct timeval startCPUTime_
struct timeval startRealTime_
#define CLOCK_PROCESS_CPUTIME_ID
double accumulatedCPUTime_
double accumulatedRealTime_
Times calculateDeltaTime() const