cryptol-3.0.0: Cryptol: The Language of Cryptography

Safe Haskell | Safe-Inferred
Language | Haskell2010

Cryptol.Utils.Benchmark

Description

Simple benchmarking of IO functions.

Synopsis

- data BenchmarkStats = BenchmarkStats {
  - benchAvgTime :: !Double
  - benchAvgCpuTime :: !Double
  - benchAvgCycles :: !Int64
  }
- benchmark :: Double -> (a -> IO b) -> a -> IO BenchmarkStats
- secs :: Double -> String

# Documentation

data BenchmarkStats Source #

Statistics returned by `benchmark`.

This is extremely crude compared to the full analysis that criterion can do, but is enough for now.

Constructors

BenchmarkStats |

Fields

- benchAvgTime :: !Double
- benchAvgCpuTime :: !Double
- benchAvgCycles :: !Int64

#### Instances

Instances details

Show BenchmarkStats Source # |
Instance details Defined in Cryptol.Utils.Benchmark Methods showsPrec :: Int -> BenchmarkStats -> ShowS Source # show :: BenchmarkStats -> String Source # showList :: [BenchmarkStats] -> ShowS Source #

benchmark :: Double -> (a -> IO b) -> a -> IO BenchmarkStats Source #

Benchmark the application of the given function to the given input and the execution of the resulting IO action to WHNF, spending at least the given amount of time in seconds to collect measurements.

secs :: Double -> String Source #

Convert a number of seconds to a string. The string will consist of four decimal places, followed by a short description of the time units.