Skip to content

Commit

Permalink
Merge pull request #56 from sjakobi/bench-ghc-clock
Browse files Browse the repository at this point in the history
Add GHC.Clock.getMonotonicTimeNSec to benchmarks
  • Loading branch information
CetinSert authored Apr 3, 2019
2 parents 49e6a9c + a5adf25 commit e5208c4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bench/benchmarks.hs
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
{-# 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" [
Expand All @@ -15,4 +20,7 @@ main = defaultMain [
, bench "MonotonicCoarse" $ whnfIO (getTime MonotonicCoarse)
, bench "RealtimeCoarse" $ whnfIO (getTime RealtimeCoarse)
]
#if MIN_VERSION_base(4,11,0)
, bench "GHC.Clock.getMonotonicTimeNSec" $ whnfIO getMonotonicTimeNSec
#endif
]

0 comments on commit e5208c4

Please sign in to comment.