Safe Haskell | None |
---|---|
Language | Haskell98 |
POSIX clocks.
- data TimeSpec
- timeSpecSeconds :: TimeSpec -> CTime
- timeSpecNanos :: TimeSpec -> CULong
- mkTimeSpec :: CTime -> CULong -> TimeSpec
- timeSpecV :: TimeSpec -> (CTime, CULong)
- timeSpecToInt64 :: TimeSpec -> Int64
- newtype Clock = Clock Int32
- monotonicClock :: Clock
- realtimeClock :: Clock
- processTimeClock :: Clock
- threadTimeClock :: Clock
- getProcessClock :: MonadBase IO μ => ProcessID -> μ Clock
- getClockResolution :: MonadBase IO μ => Clock -> μ TimeSpec
- getClockTime :: MonadBase IO μ => Clock -> μ TimeSpec
- setClockTime :: MonadBase IO μ => Clock -> TimeSpec -> μ ()
- clockSleep :: MonadBase IO μ => Clock -> TimeSpec -> μ TimeSpec
- clockSleepAbs :: MonadBase IO μ => Clock -> TimeSpec -> μ ()
Documentation
Mirrors struct timespec.
timeSpecSeconds :: TimeSpec -> CTime Source #
timeSpecNanos :: TimeSpec -> CULong Source #
mkTimeSpec :: CTime -> CULong -> TimeSpec Source #
Create a TimeSpec
from amounts of seconds and nanoseconds.
timeSpecV :: TimeSpec -> (CTime, CULong) Source #
Convert a TimeSpec
to a pair of its components.
Useful as a view pattern.
timeSpecToInt64 :: TimeSpec -> Int64 Source #
Mirrors clockid_t.
getProcessClock :: MonadBase IO μ => ProcessID -> μ Clock Source #
Get the CPU-time clock of the given process. See clock_getcpuclockid(3).
getClockResolution :: MonadBase IO μ => Clock -> μ TimeSpec Source #
Get the clock resolution. See clock_getres(3).
getClockTime :: MonadBase IO μ => Clock -> μ TimeSpec Source #
Get the clock time. See clock_gettime(3).
setClockTime :: MonadBase IO μ => Clock -> TimeSpec -> μ () Source #
Set the clock time. See clock_settime(3).