Talk:Timing computations
How about:
import Data.Time
time :: IO t -> IO t time a = do start <- getCurrentTime v <- a end <- getCurrentTime putStrLn $ "Computation time: " ++ show (diffUTCTime end start) return v
How about:
import Data.Time
time :: IO t -> IO t time a = do start <- getCurrentTime v <- a end <- getCurrentTime putStrLn $ "Computation time: " ++ show (diffUTCTime end start) return v