posix-timer-0.1: 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 :: ProcessID -> IO ClockSource

Get the CPU-time clock of the given process. See clock_getcpuclockid(3).

getClockResolution :: Clock -> IO TimeSpecSource

Get the clock resolution. See clock_getres(3).

getClockTime :: Clock -> IO TimeSpecSource

Get the clock time. See clock_gettime(3).

setClockTime :: Clock -> TimeSpec -> IO ()Source

Set the clock time. See clock_settime(3).

clockSleep :: Clock -> TimeSpec -> IO TimeSpecSource

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

clockSleepAbs :: Clock -> TimeSpec -> IO ()Source

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