-- 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
-- | 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 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 :: 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 Eq ITimerSpec
instance Show ITimerSpec
instance Eq Timer
instance Ord Timer
instance Show Timer
instance Storable Timer
instance Storable ITimerSpec