45 inline void Start(
int reset = 1);
64 # include <sys/time.h>
65 # include <sys/times.h>
71 static double gTicks = 1000;
73 # include <sys/types.h>
74 # include <sys/timeb.h>
76 # undef min // unfortunately, <windows.h> defines min/max as macros
79 const double gTicks = 1.0e-7;
80 static __int64 gTicksQPC = -1;
91 gTicks = (double)sysconf(_SC_CLK_TCK);
96 QueryPerformanceFrequency( &freq );
97 gTicksQPC = (double)freq.QuadPart;
196 gettimeofday(&tp, 0);
197 return tp.tv_sec + (tp.tv_usec)*1.
e-6;
198 #elif defined(_WIN32)
199 LARGE_INTEGER counter;
200 QueryPerformanceCounter( &counter );
201 return (
double)counter.QuadPart / gTicksQPC;
215 return (
double)(cpt.tms_utime+cpt.tms_stime) /
gTicks;
216 #elif defined(R__VMS)
217 return (
double)clock() /
gTicks;
218 #elif defined(_WIN32)
219 OSVERSIONINFO OsVersionInfo;
227 OsVersionInfo.dwOSVersionInfoSize=
sizeof(OSVERSIONINFO);
228 GetVersionEx(&OsVersionInfo);
229 if (OsVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT) {
244 HANDLE hProcess = GetCurrentProcess();
245 ret = GetProcessTimes (hProcess, &ftCreate, &ftExit,
246 &ftKernel.ftFileTime,
249 ret = GetLastError ();
261 return (
double) (ftKernel.ftInt64 + ftUser.ftInt64) *
gTicks;