packages feed

timeit (empty) → 0.9.0.0

raw patch · 3 files changed

+27/−0 lines, 3 filesdep +basesetup-changed

Dependencies added: base

Files

+ Setup.hs view
@@ -0,0 +1,3 @@+module Main where+import Distribution.Simple+main = defaultMain
+ System/TimeIt.hs view
@@ -0,0 +1,13 @@+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
+ timeit.cabal view
@@ -0,0 +1,11 @@+Name:		timeit+Version:	0.9.0.0+License:	BSD3+Author:		Lennart Augustsson+Maintainer:	Lennart Augustsson+Category:	System+Synopsis:	Time a computation+Description:	A simple wrapper of an IO computation to show the used CPU time.+Build-type:	Simple+Build-Depends:	base+Exposed-modules:	System.TimeIt