serokell-util-0.1.4.0: General-purpose functions by Serokell

Safe HaskellNone
LanguageHaskell2010

Serokell.Util.Bench

Description

Benchmark related utils.

Synopsis

Documentation

getWallTime :: (MonadIO m, TimeUnit a) => m a Source #

Get current wall-clock time as any time unit.

getCpuTime :: (MonadIO m, TimeUnit a) => m a Source #

Get current CPU time as any time unit.

data ElapsedTime Source #

Data type describing time passed during execution of something.

measureTime :: MonadIO m => m a -> m (ElapsedTime, a) Source #

Run given action and measure how much time it took.

measureTime_ :: MonadIO m => m a -> m ElapsedTime Source #

Run given action and measure how much time it took, discarding result of action.

perSecond :: (Real a, Fractional b) => a -> TimeSpec -> b Source #

Given number of actions executed during some time, this function calculates how much actions were executed per second (on average).