1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
{-# language CPP #-}
module Main (main) where
import Criterion.Main
import System.Clock
#if MIN_VERSION_base(4,11,0)
import GHC.Clock
#endif
main :: IO ()
main = defaultMain [
bgroup "getTime" [
bench "Monotonic" $ whnfIO (getTime Monotonic)
, bench "Realtime" $ whnfIO (getTime Realtime)
, bench "ProcessCPUTime" $ whnfIO (getTime ProcessCPUTime)
, bench "ThreadCPUTime" $ whnfIO (getTime ThreadCPUTime)
, bench "MonotonicRaw" $ whnfIO (getTime MonotonicRaw)
, bench "Boottime" $ whnfIO (getTime Boottime)
, bench "MonotonicCoarse" $ whnfIO (getTime MonotonicCoarse)
, bench "RealtimeCoarse" $ whnfIO (getTime RealtimeCoarse)
]
#if MIN_VERSION_base(4,11,0)
, bench "GHC.Clock.getMonotonicTimeNSec" $ whnfIO getMonotonicTimeNSec
#endif
]
|