X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=System%2FCPUTime.hsc;fp=System%2FCPUTime.hsc;h=7fe4fc2a74ad17ee38508fc2a9375d4f6d4f8804;hb=8cd48b73c49ffe2685df8bd623b9eeb8de75ed69;hp=307b2a2ddb796ccf58083555516f23913196ab5e;hpb=606ec04189d5038f6b5a6cc09cfe2e1ee10f8dad;p=ghc-base.git diff --git a/System/CPUTime.hsc b/System/CPUTime.hsc index 307b2a2..7fe4fc2 100644 --- a/System/CPUTime.hsc +++ b/System/CPUTime.hsc @@ -37,10 +37,12 @@ import Foreign.C #include "HsBase.h" #endif +#if !defined(mingw32_HOST_OS) && !defined(cygwin32_HOST_OS) realToInteger :: Real a => a -> Integer realToInteger ct = round (realToFrac ct :: Double) -- CTime, CClock, CUShort etc are in Real but not Fractional, -- so we must convert to Double before we can round it +#endif #ifdef __GLASGOW_HASKELL__ -- ----------------------------------------------------------------------------- @@ -115,7 +117,7 @@ foreign import ccall unsafe times :: Ptr CTms -> IO CClock low <- (#peek FILETIME,dwLowDateTime) ft :: IO Word32 -- Convert 100-ns units to picosecs (10^-12) -- => multiply by 10^5. - return (((fromIntegral high) * (2^32) + (fromIntegral low)) * 100000) + return (((fromIntegral high) * (2^(32::Int)) + (fromIntegral low)) * 100000) -- ToDo: pin down elapsed times to just the OS thread(s) that -- are evaluating/managing Haskell code.