11 #include < Windows.h > 13 #if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) 14 #define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64 16 #define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL 19 int gettimeofday(
struct timeval *tv,
struct timezone *tz) {
21 unsigned __int64 tmpres = 0;
25 GetSystemTimeAsFileTime(&ft);
27 tmpres |= ft.dwHighDateTime;
29 tmpres |= ft.dwLowDateTime;
33 tmpres -= DELTA_EPOCH_IN_MICROSECS;
34 tv->tv_sec = (long)(tmpres / 1000000UL);
35 tv->tv_usec = (long)(tmpres % 1000000UL);
43 tz->tz_minuteswest = _timezone / 60;
44 tz->tz_dsttime = _daylight;