14 #include <sys/resource.h>
37 accumulatedRealTime_(0),
38 accumulatedCPUTime_(0) {
39 #ifdef USE_CLOCK_GETTIME
76 #ifdef USE_CLOCK_GETTIME
81 if(0 != getrusage(RUSAGE_SELF, &theUsage)) {
84 startCPUTime_.tv_sec =theUsage.ru_stime.tv_sec+theUsage.ru_utime.tv_sec;
85 startCPUTime_.tv_usec =theUsage.ru_stime.tv_usec+theUsage.ru_utime.tv_usec;
121 #ifdef USE_CLOCK_GETTIME
122 double const nanosecToSec = 1E-9;
131 if(0 != getrusage(RUSAGE_SELF, &theUsage)) {
134 double const microsecToSec = 1E-6;
137 gettimeofday(&tp, 0);
139 returnValue.
cpu_ = theUsage.ru_stime.tv_sec + theUsage.ru_utime.tv_sec -
startCPUTime_.tv_sec +
140 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