-- 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.3.0.2
-- | 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 :: MonadBase IO μ => ProcessID -> μ Clock
-- | Get the clock resolution. See clock_getres(3).
getClockResolution :: MonadBase IO μ => Clock -> μ TimeSpec
-- | Get the clock time. See clock_gettime(3).
getClockTime :: MonadBase IO μ => Clock -> μ TimeSpec
-- | Set the clock time. See clock_settime(3).
setClockTime :: MonadBase IO μ => Clock -> TimeSpec -> μ ()
-- | Sleep for the specified duration. When interrupted by a signal,
-- returns the amount of time left to sleep. See
-- clock_nanosleep(3).
clockSleep :: MonadBase IO μ => Clock -> TimeSpec -> μ TimeSpec
-- | Sleep until the clock time reaches the specified value. See
-- clock_nanosleep(3).
clockSleepAbs :: MonadBase IO μ => Clock -> TimeSpec -> μ ()
instance GHC.Show.Show System.Posix.Clock.TimeSpec
instance GHC.Classes.Eq System.Posix.Clock.TimeSpec
instance Foreign.Storable.Storable System.Posix.Clock.Clock
instance GHC.Show.Show System.Posix.Clock.Clock
instance GHC.Classes.Ord System.Posix.Clock.Clock
instance GHC.Classes.Eq System.Posix.Clock.Clock
instance GHC.Classes.Ord System.Posix.Clock.TimeSpec
instance GHC.Enum.Bounded System.Posix.Clock.TimeSpec
instance GHC.Num.Num System.Posix.Clock.TimeSpec
instance GHC.Real.Real System.Posix.Clock.TimeSpec
instance GHC.Enum.Enum System.Posix.Clock.TimeSpec
instance GHC.Real.Integral System.Posix.Clock.TimeSpec
instance Foreign.Storable.Storable System.Posix.Clock.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 :: MonadBase IO μ => Clock -> Maybe (Signal, WordPtr) -> μ Timer
-- | Setup the timer. See timer_settime(3).
configureTimer :: MonadBase IO μ => Timer -> Bool -> TimeSpec -> TimeSpec -> μ (TimeSpec, TimeSpec)
-- | Get the amount of time left until the next expiration and the interval
-- between the subsequent expirations. See timer_gettime(3).
timerTimeLeft :: MonadBase IO μ => Timer -> μ (TimeSpec, TimeSpec)
-- | Get the timer overrun count. See timer_getoverrun(3).
timerOverrunCnt :: MonadBase IO μ => Timer -> μ CInt
-- | Destroy the timer. See timer_delete(3).
destroyTimer :: MonadBase IO μ => Timer -> μ ()
instance GHC.Show.Show System.Posix.Timer.ITimerSpec
instance GHC.Classes.Eq System.Posix.Timer.ITimerSpec
instance Foreign.Storable.Storable System.Posix.Timer.Timer
instance GHC.Show.Show System.Posix.Timer.Timer
instance GHC.Classes.Ord System.Posix.Timer.Timer
instance GHC.Classes.Eq System.Posix.Timer.Timer
instance Foreign.Storable.Storable System.Posix.Timer.ITimerSpec