4 #include "PortableGettimeofday.h"
6 #if defined(__WIN32__) || defined(WIN32) || defined(_WIN32) || defined(_MSC_VER)
8 #if defined(__MINGW32__) && (3 < __MINGW32_MAJOR_VERSION || 3 == __MINGW32_MAJOR_VERSION && 9 < __MINGW32_MINOR_VERSION)
11 #ifndef IO_ADDON_Sockets
12 void gettimeofday(struct timeval
*tv
, struct timezone
*tz
)
14 TIME_ZONE_INFORMATION zoneInfo
;
19 tv
->tv_sec
= (long) timeb
.time
;
20 tv
->tv_usec
= (long) (timeb
.millitm
* 1000);
22 if (GetTimeZoneInformation(&zoneInfo
) != TIME_ZONE_ID_INVALID
)
24 tz
->tz_minuteswest
= zoneInfo
.Bias
;
29 tz
->tz_minuteswest
= 0;
37 /* just to make compiler happy */
38 void PortableGettimeOfday(void)
44 double secondsSince1970(void)
49 gettimeofday(&tv
, &tz
);
51 result
+= tv
.tv_usec
/ 1000000.0;