haskus-system-0.7.0.0: Haskus system programming framework

Safe HaskellNone
LanguageHaskell2010

Haskus.System.Linux.Time

Description

Linux time

Synopsis

Documentation

data TimeSpec Source #

Time spec

Constructors

TimeSpec 

Instances

Eq TimeSpec Source # 
Ord TimeSpec Source # 
Show TimeSpec Source # 
Generic TimeSpec Source # 

Associated Types

type Rep TimeSpec :: * -> * #

Methods

from :: TimeSpec -> Rep TimeSpec x #

to :: Rep TimeSpec x -> TimeSpec #

Storable TimeSpec Source # 
type Rep TimeSpec Source # 
type Rep TimeSpec = D1 (MetaData "TimeSpec" "Haskus.System.Linux.Time" "haskus-system-0.7.0.0-FRxqghdHeI3NpHOm98r9a" False) (C1 (MetaCons "TimeSpec" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "tsSeconds") SourceUnpack SourceStrict DecidedUnpack) (Rec0 Int64)) (S1 (MetaSel (Just Symbol "tsNanoSeconds") SourceUnpack SourceStrict DecidedUnpack) (Rec0 Int64))))

data TimeVal Source #

Time val

Constructors

TimeVal 

Instances

Eq TimeVal Source # 

Methods

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

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

Ord TimeVal Source # 
Show TimeVal Source # 
Generic TimeVal Source # 

Associated Types

type Rep TimeVal :: * -> * #

Methods

from :: TimeVal -> Rep TimeVal x #

to :: Rep TimeVal x -> TimeVal #

Storable TimeVal Source # 
type Rep TimeVal Source # 
type Rep TimeVal = D1 (MetaData "TimeVal" "Haskus.System.Linux.Time" "haskus-system-0.7.0.0-FRxqghdHeI3NpHOm98r9a" False) (C1 (MetaCons "TimeVal" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "tvSeconds") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Word64)) (S1 (MetaSel (Just Symbol "tvMicroSeconds") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Word64))))

timeValDiff :: TimeVal -> TimeVal -> Word64 Source #

Timeval difference in microseconds

data Clock Source #

Clocks

Constructors

ClockWall

System-wide wall clock

ClockMonotonic

Monotonic clock from unspecified starting point

ClockProcess

Per-process CPU-time clock (CPU time consumed by all threads in the process)

ClockThread

Thread-specific CPU-time clock

ClockRawMonotonic

Hardware-based monotonic clock

ClockCoarseWall

Faster but less precise wall clock

ClockCoarseMonotonic

Faster but less precise monotonic clock

ClockBoot

Monotonic clock that includes any time that the system is suspended

ClockWallAlarm

Like wall clock, but timers on this clock can wake-up a suspended system

ClockBootAlarm

Like boot clock, but timers on this clock can wake-up a suspended system

ClockTAI

Like wall clock but in International Atomic Time

sysClockGetTime :: MonadInIO m => Clock -> Flow m '[TimeSpec, ErrorCode] Source #

Retrieve clock time

sysClockSetTime :: MonadInIO m => Clock -> TimeSpec -> Flow m '[(), ErrorCode] Source #

Set clock time

sysClockGetResolution :: MonadInIO m => Clock -> Flow m '[TimeSpec, ErrorCode] Source #

Retrieve clock resolution

sysGetTimeOfDay :: MonadInIO m => Flow m '[TimeVal, ErrorCode] Source #

Retrieve time of day

sysSetTimeOfDay :: MonadInIO m => TimeVal -> Flow m '[(), ErrorCode] Source #

Set time of day

sysNanoSleep :: MonadInIO m => TimeSpec -> Flow m '[SleepResult, ErrorCode] Source #

Suspend the calling thread for the specified amount of time

Can be interrupted by a signal (in this case it returns the remaining time)

nanoSleep :: MonadInIO m => TimeSpec -> Flow m '[(), ErrorCode] Source #

Suspend the calling thread for the specified amount of time

When interrupted by a signal, suspend again for the remaining amount of time