timeit-0.9.0.0: System/TimeIt.hs
module System.TimeIt(timeIt) where
import System.CPUTime
import Text.Printf
timeIt :: IO a -> IO a
timeIt ioa = do
t1 <- getCPUTime
a <- ioa
t2 <- getCPUTime
let t :: Double
t = fromIntegral (t2-t1) * 1e-12
printf "CPU time: %6.2fs\n" t
return a