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.
mkTimeSpec :: CTime -> CULong -> TimeSpecSource
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.
getProcessClock :: MonadBase IO μ => ProcessID -> μ ClockSource
Get the CPU-time clock of the given process. See clock_getcpuclockid(3).
getClockResolution :: MonadBase IO μ => Clock -> μ TimeSpecSource
Get the clock resolution. See clock_getres(3).
getClockTime :: MonadBase IO μ => Clock -> μ TimeSpecSource
Get the clock time. See clock_gettime(3).
setClockTime :: MonadBase IO μ => Clock -> TimeSpec -> μ ()Source
Set the clock time. See clock_settime(3).