66 static double now(
bool measureWallclockTime =
true) {
68 if(measureWallclockTime){
69 return static_cast<double>(std::clock()) / CLOCKS_PER_SEC;
72 LARGE_INTEGER tick, tps;
73 QueryPerformanceFrequency(&tps);
74 QueryPerformanceCounter(&tick);
75 return(
static_cast<double>( tick.QuadPart ) /
static_cast<double>( tps.QuadPart ) );
78 if(measureWallclockTime){
80 if (gettimeofday(&time,0)){
84 return time.tv_sec +1e-6 *time.tv_usec;
89 getrusage(RUSAGE_SELF, &res);
90 return(res.ru_utime.tv_sec + res.ru_stime.tv_sec)
91 + 1e-6 * (res.ru_utime.tv_usec + res.ru_stime.tv_usec);