Loading lib/timeval.c +30 −16 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ int gettimeofday (struct timeval *tp, void *nothing) { #ifdef WITHOUT_MM_LIB SYSTEMTIME st; time_t tt; struct tm tmtm; Loading @@ -47,6 +48,19 @@ gettimeofday (struct timeval *tp, void *nothing) tt = mktime (&tmtm); tp->tv_sec = tt; tp->tv_usec = st.wMilliseconds * 1000; #else /** ** The earlier time calculations using GetLocalTime ** had a time resolution of 10ms.The timeGetTime, part ** of multimedia apis offer a better time resolution ** of 1ms.Need to link against winmm.lib for this **/ unsigned long Ticks = 0; Ticks = timeGetTime(); tp->tv_sec = Ticks%1000; tp->tv_usec = (Ticks - (tp->tv_sec*1000))*1000; #endif return 1; } #define HAVE_GETTIMEOFDAY Loading Loading
lib/timeval.c +30 −16 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ int gettimeofday (struct timeval *tp, void *nothing) { #ifdef WITHOUT_MM_LIB SYSTEMTIME st; time_t tt; struct tm tmtm; Loading @@ -47,6 +48,19 @@ gettimeofday (struct timeval *tp, void *nothing) tt = mktime (&tmtm); tp->tv_sec = tt; tp->tv_usec = st.wMilliseconds * 1000; #else /** ** The earlier time calculations using GetLocalTime ** had a time resolution of 10ms.The timeGetTime, part ** of multimedia apis offer a better time resolution ** of 1ms.Need to link against winmm.lib for this **/ unsigned long Ticks = 0; Ticks = timeGetTime(); tp->tv_sec = Ticks%1000; tp->tv_usec = (Ticks - (tp->tv_sec*1000))*1000; #endif return 1; } #define HAVE_GETTIMEOFDAY Loading