hosc-0.10.1: Haskell Open Sound Control

Sound.OpenSoundControl.Time

Description

Temporal representations and clock operations (read current time and pause thread).

Synopsis

Documentation

type NTPi = Word64Source

Type for integer representation of NTP time.

data Time Source

Time is represented in either UTC or NTP form. The NTP form may be either integral or real.

Constructors

UTCr Double 
NTPr Double 
NTPi NTPi 

Instances

Eq Time 
Ord Time

Times can be ordered, avoid coercion if not required.

Read Time 
Show Time 

as_ntpi :: Time -> NTPiSource

Coerce to NTPi form.

as_utcr :: Time -> DoubleSource

Coerce to UTCr form.

ntpr_ntpi :: Double -> NTPiSource

Convert a real-valued NTP timestamp to an NTP timestamp.

ntpi_ntpr :: NTPi -> DoubleSource

Convert an NTP timestamp to a real-valued NTP timestamp.

utcr_ntpi :: Double -> NTPiSource

Convert UTC timestamp to NTP timestamp.

ntpr_utcr :: Double -> DoubleSource

Convert NTP timestamp to UTC timestamp.

ntpi_utcr :: NTPi -> DoubleSource

Convert NTP timestamp to UTC timestamp.

utc_base :: UTCTimeSource

The time at 1970-01-01:00:00:00.

utcr :: IO DoubleSource

Read current UTCr timestamp.

ntpi :: IO NTPiSource

Read current NTP timestamp.

pauseThreadLimit :: DoubleSource

The pauseThread limit (in seconds). Values larger than this require a different thread delay mechanism, see sleepThread. The value is the number of microseconds in maxBound::Int.

pauseThread :: Double -> IO ()Source

Pause current thread for the indicated duration (in seconds), see pauseThreadLimit. Note also that this function does not attempt pauses less than 1e-4.

pauseThreadUntil :: Double -> IO ()Source

Pause current thread until the given utcr time, see pauseThreadLimit.

sleepThread :: Double -> IO ()Source

Sleep current thread for the indicated duration (in seconds). Divides long sleeps into parts smaller than pauseThreadLimit.

sleepThreadUntil :: Double -> IO ()Source

Sleep current thread until the given utcr time. Divides long sleeps into parts smaller than pauseThreadLimit.

immediately :: TimeSource

Execute the bundle immediately.