5 #ifndef __pinocchio_utils_timer_hpp__
6 #define __pinocchio_utils_timer_hpp__
12 int gettimeofday(
struct timeval * tp,
struct timezone * tzp)
19 SYSTEMTIME system_time;
23 GetSystemTime(&system_time);
24 SystemTimeToFileTime(&system_time, &file_time);
25 time = ((
uint64_t)file_time.dwLowDateTime);
26 time += ((
uint64_t)file_time.dwHighDateTime) << 32;
28 tp->tv_sec = (long)((time - EPOCH) / 10000000
L);
29 tp->tv_usec = (long)(system_time.wMilliseconds * 1000);
38 #define SMOOTH(s) for (size_t _smooth = 0; _smooth < s; ++_smooth)
41 inline double operator-(
const struct timeval & t1,
const struct timeval & t0)
44 return double(t1.tv_sec - t0.tv_sec) + 1e-6 * double(t1.tv_usec - t0.tv_usec);
74 std::stack<struct timeval>
stack;
75 mutable struct timeval
t0;
85 gettimeofday(&(
stack.top()), NULL);
95 gettimeofday(&
t0, NULL);
107 #endif // ifndef __pinocchio_utils_timer_hpp__