foundation-0.0.30: 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 #

Constructors

Timing |
Fields timeDiff :: !NanoSeconds timeBytesAllocated :: !(Maybe Word64)

data Measure #

Constructors

Measure |
Fields measurements :: UArray NanoSeconds iters :: Word

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

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

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

In depth timing & other metrics analysis of a function