47 #include "config_HAVE_OPENMP.hpp" 58 #include <sys/times.h> 64 #if defined(_SC_CLK_TCK) 65 #define TIMES_TICKS_PER_SEC sysconf(_SC_CLK_TCK) 66 #elif defined(CLK_TCK) 67 #define TIMES_TICKS_PER_SEC CLK_TCK 69 #define TIMES_TICKS_PER_SEC HZ 70 #else // !CLK_TCK && !_SC_CLK_TCK && !HZ 71 #define TIMES_TICKS_PER_SEC 60 72 #endif // !CLK_TCK && !_SC_CLK_TCK && !HZ 81 FILETIME creationTime, exitTime, kernelTime, userTime;
82 if(GetProcessTimes(GetCurrentProcess(), &creationTime, &exitTime, &kernelTime, &userTime))
84 ULARGE_INTEGER integerTime;
85 integerTime.u.LowPart = userTime.dwLowDateTime;
86 integerTime.u.HighPart = userTime.dwHighDateTime;
87 return (
long)(integerTime.QuadPart / 10000);
94 clock_t ret =
times(&now);
95 if(ret == static_cast<clock_t>(-1))
98 now.tms_utime = now.tms_stime = now.tms_cutime = now.tms_cstime = 0;
113 ost = std::to_string(t / 1000) +
".";
114 long centisec = (t % 1000) / 10;
117 ost +=
"0" + std::to_string(centisec);
121 ost += std::to_string(centisec);
133 #define START_TIME(time_var) time_var = p_cpu_time() 136 #define STOP_TIME(time_var) time_var = p_cpu_time() - (time_var) 145 return static_cast<long int>(1000 * omp_get_wtime());
152 #define START_WTIME(time_var) time_var = p_cpu_wtime() 155 #define STOP_WTIME(time_var) time_var = p_cpu_wtime() - (time_var)
File containing functions and utilities to support the printing of debug messagges.
long int p_cpu_wtime()
return a long which represents the elapsed wall processor time in milliseconds since some constant re...
#define INDENT_OUT_MEX(outLevel, curOutLevel, mex)
#define TIMES_TICKS_PER_SEC
void dump_exec_time(const std::string &thing, long et)
std::string print_cpu_time(long int t)
massage a long which represents a time interval in milliseconds, into a string suitable for output ...
long int p_cpu_time()
return a long which represents the elapsed processor time in milliseconds since some constant referen...