-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Bindings to POSIX clock and timer functions.
--
-- This package provides bindings to POSIX clock and timer functions.
@package posix-timer
@version 0.1
-- | POSIX clocks.
module System.Posix.Clock
-- | Mirrors struct timespec.
data TimeSpec
timeSpecSeconds :: TimeSpec -> CTime
timeSpecNanos :: TimeSpec -> CULong
-- | Create a TimeSpec from amounts of seconds and nanoseconds.
mkTimeSpec :: CTime -> CULong -> TimeSpec
-- | Convert a TimeSpec to a pair of its components. Useful as a
-- view pattern.
timeSpecV :: TimeSpec -> (CTime, CULong)
timeSpecToInt64 :: TimeSpec -> Int64
-- | Mirrors clockid_t.
newtype Clock
Clock :: Int32 -> Clock
monotonicClock :: Clock
realtimeClock :: Clock
processTimeClock :: Clock
threadTimeClock :: Clock
-- | Get the CPU-time clock of the given process. See
-- clock_getcpuclockid(3).
getProcessClock :: ProcessID -> IO Clock
-- | Get the clock resolution. See clock_getres(3).
getClockResolution :: Clock -> IO TimeSpec
-- | Get the clock time. See clock_gettime(3).
getClockTime :: Clock -> IO TimeSpec
-- | Set the clock time. See clock_settime(3).
setClockTime :: Clock -> TimeSpec -> IO ()
-- | Sleep for the specified duration. When interrupted by a signal,
-- returns the amount of time left to sleep. See
-- clock_nanosleep(3).
clockSleep :: Clock -> TimeSpec -> IO TimeSpec
-- | Sleep until the clock time reaches the specified value. See
-- clock_nanosleep(3).
clockSleepAbs :: Clock -> TimeSpec -> IO ()
instance Eq TimeSpec
instance Show TimeSpec
instance Eq Clock
instance Ord Clock
instance Show Clock
instance Storable Clock
instance Storable TimeSpec
instance Integral TimeSpec
instance Enum TimeSpec
instance Real TimeSpec
instance Num TimeSpec
instance Bounded TimeSpec
instance Ord TimeSpec
-- | POSIX timers.
module System.Posix.Timer
-- | Mirrors struct itimerspec.
data ITimerSpec
ITimerSpec :: !TimeSpec -> !TimeSpec -> ITimerSpec
iTimerSpecInterval :: ITimerSpec -> !TimeSpec
iTimerSpecValue :: ITimerSpec -> !TimeSpec
-- | Mirrors timer_t.
data Timer
-- | Create a timer. See timer_create(3).
createTimer :: Clock -> Maybe (Signal, WordPtr) -> IO Timer
-- | Setup the timer. See timer_settime(3).
configureTimer :: Timer -> Bool -> TimeSpec -> TimeSpec -> IO (TimeSpec, TimeSpec)
-- | Get the amount of time left until the next expiration and the interval
-- between the subsequent expirations. See timer_gettime(3).
timerTimeLeft :: Timer -> IO (TimeSpec, TimeSpec)
-- | Get the timer overrun count. See timer_getoverrun(3).
timerOverrunCnt :: Timer -> IO CInt
-- | Destroy the timer. See timer_delete(3).
destroyTimer :: Timer -> IO ()
instance Eq ITimerSpec
instance Show ITimerSpec
instance Eq Timer
instance Ord Timer
instance Show Timer
instance Storable Timer
instance Storable ITimerSpec