X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=cbits%2FWin32Utils.c;h=0f4eb520efcc8353186f998e650d3edb771766ab;hb=c5a5a3183ce8e4b36dab2b6cdef6260ce7f41a7e;hp=942b2c47a3ac9fe12e0a1b74265bed0ee02b6add;hpb=4ff009b65beefe01fe812a68f60269279bdc056e;p=haskell-directory.git diff --git a/cbits/Win32Utils.c b/cbits/Win32Utils.c index 942b2c4..0f4eb52 100644 --- a/cbits/Win32Utils.c +++ b/cbits/Win32Utils.c @@ -107,18 +107,16 @@ void maperrno (void) errno = EINVAL; } -#define TICKS_PER_SECOND 50 -// must match GHC.Conc.tick_freq - -HsInt getTicksOfDay(void) +HsWord64 getUSecOfDay(void) { - HsInt64 t; + HsWord64 t; FILETIME ft; GetSystemTimeAsFileTime(&ft); - t = ((HsInt64)ft.dwHighDateTime << 32) | ft.dwLowDateTime; - t = (t * TICKS_PER_SECOND) / 10000000LL; - /* FILETIMES are in units of 100ns */ - return (HsInt)t; + t = ((HsWord64)ft.dwHighDateTime << 32) | ft.dwLowDateTime; + t = t / 10LL; + /* FILETIMES are in units of 100ns, + so we divide by 10 to get microseconds */ + return t; } #endif