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

Safe HaskellNone
LanguageHaskell98

System.Posix.Clock

Description

POSIX clocks.

Synopsis

Documentation

data TimeSpec Source #

Mirrors struct timespec.

Instances

Bounded TimeSpec Source # 
Enum TimeSpec Source # 
Eq TimeSpec Source # 
Integral TimeSpec Source # 
Num TimeSpec Source # 
Ord TimeSpec Source # 
Real TimeSpec Source # 
Show TimeSpec Source # 
Storable TimeSpec 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.

newtype Clock Source #

Mirrors clockid_t.

Constructors

Clock Int32 

Instances

Eq Clock Source # 

Methods

(==) :: Clock -> Clock -> Bool #

(/=) :: Clock -> Clock -> Bool #

Ord Clock Source # 

Methods

compare :: Clock -> Clock -> Ordering #

(<) :: Clock -> Clock -> Bool #

(<=) :: Clock -> Clock -> Bool #

(>) :: Clock -> Clock -> Bool #

(>=) :: Clock -> Clock -> Bool #

max :: Clock -> Clock -> Clock #

min :: Clock -> Clock -> Clock #

Show Clock Source # 

Methods

showsPrec :: Int -> Clock -> ShowS #

show :: Clock -> String #

showList :: [Clock] -> ShowS #

Storable Clock Source # 

Methods

sizeOf :: Clock -> Int #

alignment :: Clock -> Int #

peekElemOff :: Ptr Clock -> Int -> IO Clock #

pokeElemOff :: Ptr Clock -> Int -> Clock -> IO () #

peekByteOff :: Ptr b -> Int -> IO Clock #

pokeByteOff :: Ptr b -> Int -> Clock -> IO () #

peek :: Ptr Clock -> IO Clock #

poke :: Ptr Clock -> Clock -> IO () #

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

clockSleep :: MonadBase IO μ => Clock -> TimeSpec -> μ TimeSpec Source #

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