5 #ifndef _WIN_GETTIMEOFDAY_H_ 6 #define _WIN_GETTIMEOFDAY_H_ 8 #include "libmesh/libmesh_config.h" 10 #ifndef LIBMESH_HAVE_GETTIMEOFDAY 13 #define WIN32_LEAN_AND_MEAN 27 static const uint64_t EPOCH = ((uint64_t) 116444736000000000ULL);
29 SYSTEMTIME system_time;
33 GetSystemTime(&system_time);
34 SystemTimeToFileTime(&system_time, &file_time);
35 time = ((uint64_t)file_time.dwLowDateTime );
36 time += ((uint64_t)file_time.dwHighDateTime) << 32;
38 tp->
tv_sec = (long) ((time - EPOCH) / 10000000L);
39 tp->
tv_usec = (long) (system_time.wMilliseconds * 1000);
43 #error "gettimeofday() is not implemented" 45 #endif // !LIBMESH_HAVE_GETTIMEOFDAY 47 #endif // _WIN_GETTIMEOFDAY_H_
int gettimeofday(struct timeval *tp, struct timezone *tzp)