1 /* 2 * From http://www.openasthra.com/c-tidbits/gettimeofday-function-for-windows/ 3 */ 4 #include <time.h> 5 //#include <windows.h> 6 #include <winsock2.h> 7 8 /* 9 #if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) 10 #define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64 11 #else 12 #define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL 13 #endif 14 15 struct timezone 16 { 17 int tz_minuteswest; /* minutes W of Greenwich * 18 int tz_dsttime; /* type of dst correction * 19 }; 20 21 int gettimeofday(struct timeval *tv, struct timezone *tz); 22 23 #define timeradd(a, b, result) \ 24 do { \ 25 (result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \ 26 (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \ 27 if ((result)->tv_usec >= 1000000) \ 28 { \ 29 ++(result)->tv_sec; \ 30 (result)->tv_usec -= 1000000; \ 31 } \ 32 } while (0) 33 */ 34