X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=cbits%2FWin32Utils.c;h=0f4eb520efcc8353186f998e650d3edb771766ab;hb=748003827970cfc57cb26db256b72d16e504bb37;hp=942b2c47a3ac9fe12e0a1b74265bed0ee02b6add;hpb=1d4ff287d9057348f811d8d447a321ad617ecfdf;p=ghc-base.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