foundation-0.0.25: Alternative prelude with batteries and no dependencies

License | BSD-style
Maintainer | Foundation maintainers
Safe Haskell | None
Language | Haskell2010

Foundation.Timing

Description

An implementation of a timing framework

Synopsis

- data Timing = Timing {
  - timeDiff :: !NanoSeconds
  - timeBytesAllocated :: !(Maybe Word64)
  }
- data Measure = Measure {
  - measurements :: UArray NanoSeconds
  - iters :: Word
  }
- stopWatch :: (a -> b) -> a -> IO Timing
- measure :: Word -> (a -> b) -> a -> IO Measure

# Documentation

data Timing Source #

Constructors

Timing |

Fields

- timeDiff :: !NanoSeconds
- timeBytesAllocated :: !(Maybe Word64)

data Measure Source #

Constructors

Measure |

Fields

- measurements :: UArray NanoSeconds
- iters :: Word

stopWatch :: (a -> b) -> a -> IO Timing Source #

Simple one-time measurement of time & other metrics spent in a function

measure :: Word -> (a -> b) -> a -> IO Measure Source #

In depth timing & other metrics analysis of a function