2 | import public System.Clock
16 | showTime' : Clock Duration -> String
17 | showTime' t = show $
(cast {to=Double} (seconds t)) + (cast {to=Double} (nanoseconds t) / 1000000000)
20 | timeIt' : HasIO io => String -> io a -> io (Clock Duration,a)
21 | timeIt' str act = do
22 | now <- liftIO $
clockTime Monotonic
24 | later <- liftIO $
clockTime Monotonic
25 | let dif = timeDifference later now
26 | putStrLn $
str ++ ": " ++ showTime' dif
31 | timeIt : HasIO io => String -> io a -> io a
33 | now <- liftIO $
clockTime Monotonic
35 | later <- liftIO $
clockTime Monotonic
36 | let dif = timeDifference later now
37 | putStrLn $
str ++ ": " ++ showTime' dif