diff --git a/benchmarks/AesonEncode.hs b/benchmarks/AesonEncode.hs index da41bee78..7ae6189ff 100644 --- a/benchmarks/AesonEncode.hs +++ b/benchmarks/AesonEncode.hs @@ -38,5 +38,7 @@ main = do Done _ r -> rnf (encode r) `seq` loop (n+1) r _ -> error $ "failed to read " ++ show arg loop 0 r - end <- getCurrentTime - putStrLn $ " " ++ show (diffUTCTime end start) + delta <- flip diffUTCTime start `fmap` getCurrentTime + let rate = fromIntegral count / (fromRational . toRational) delta :: Double + putStrLn $ " " ++ show delta + putStrLn $ " " ++ show (round rate) ++ " per second" diff --git a/benchmarks/AesonParse.hs b/benchmarks/AesonParse.hs index 7a33e950d..9164a5531 100644 --- a/benchmarks/AesonParse.hs +++ b/benchmarks/AesonParse.hs @@ -27,5 +27,7 @@ main = do Done _ r -> loop (good+1) bad _ -> loop good (bad+1) (good, _) <- loop 0 0 - end <- getCurrentTime - putStrLn $ " " ++ show good ++ " good, " ++ show (diffUTCTime end start) + delta <- flip diffUTCTime start `fmap` getCurrentTime + putStrLn $ " " ++ show good ++ " good, " ++ show delta + let rate = fromIntegral count / (fromRational . toRational) delta :: Double + putStrLn $ " " ++ show (round rate) ++ " per second"