posix-timer-0.3: Bindings to POSIX clock and timer functions.

System.Posix.Clock

Description

POSIX clocks.

Synopsis

Documentation

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.

newtype Clock Source

Mirrors clockid_t.

Constructors

Clock Int32 

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).

clockSleep :: MonadBase IO μ => Clock -> TimeSpec -> μ TimeSpecSource

Sleep for the specified duration. When interrupted by a signal, returns the amount of time left to sleep. See clock_nanosleep(3).

clockSleepAbs :: MonadBase IO μ => Clock -> TimeSpec -> μ ()Source

Sleep until the clock time reaches the specified value. See clock_nanosleep(3).