% -----------------------------------------------------------------------------
-% $Id: CPUTime.lhs,v 1.27 2001/01/11 17:25:57 simonmar Exp $
+% $Id: CPUTime.lhs,v 1.29 2001/02/22 16:48:24 qrczak Exp $
%
% (c) The University of Glasgow, 1995-2000
%
import PrelBase ( Int(..) )
import PrelByteArr ( ByteArray(..), newIntArray )
import PrelArrExtra ( unsafeFreezeByteArray )
-import PrelNum ( fromInt )
import PrelIOBase ( IOException(..),
IOErrorType( UnsupportedOperation ),
unsafePerformIO, stToIO, ioException )
cpuTimePrecision :: Integer
cpuTimePrecision = round ((1000000000000::Integer) %
- fromInt (unsafePerformIO clockTicks))
+ fromIntegral (unsafePerformIO clockTicks))
foreign import "libHS_cbits" "getCPUTime" unsafe primGetCPUTime :: ByteArray Int -> IO Int
foreign import "libHS_cbits" "clockTicks" unsafe clockTicks :: IO Int