| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
Imj.Timing
Description
This modules exports types and functions related to timing.
- newtype KeyTime = KeyTime SystemTime
- addDuration :: DiffTime -> KeyTime -> KeyTime
- addToSystemTime :: DiffTime -> SystemTime -> SystemTime
- diffSystemTime :: SystemTime -> SystemTime -> DiffTime
- diffTimeSecToMicros :: DiffTime -> Int
- floatSecondsToDiffTime :: Float -> DiffTime
- data SystemTime :: * = MkSystemTime {}
- data DiffTime :: *
- getSystemTime :: IO SystemTime
KeyTime
A wrapper type on SystemTime
Represents deadlines and event times.
Constructors
| KeyTime SystemTime |
SystemTime / DiffTime utilities
addToSystemTime :: DiffTime -> SystemTime -> SystemTime Source #
Adds a DiffTime to a SystemTime
Reexports
data SystemTime :: * #
SystemTime is time returned by system clock functions.
Its semantics depends on the clock function, but the epoch is typically the beginning of 1970.
Note that systemNanoseconds of 1E9 to 2E9-1 can be used to represent leap seconds.
Constructors
| MkSystemTime | |
Fields
| |
Instances
This is a length of time, as measured by a clock. Conversion functions will treat it as seconds. It has a precision of 10^-12 s.
getSystemTime :: IO SystemTime #
Get the system time, epoch start of 1970 UTC, leap-seconds ignored.
getSystemTime is typically much faster than getCurrentTime.