Safe Haskell | None |
---|
OSC related timing functions.
OSC timestamps are NTP
values, http://ntp.org/.
getCurrentTime
gives UTC
values. The Time
type is a union
of the different representations.
utcr
reads the current time as real valued UTC
and
pauseThread
suspends the current thread for a real valued number
of seconds.
- type NTPi = Word64
- data Time
- as_ntpi :: Time -> NTPi
- as_utcr :: Time -> Double
- ntpr_ntpi :: Double -> NTPi
- ntpi_ntpr :: NTPi -> Double
- utcr_ntpi :: Double -> NTPi
- ntpr_utcr :: Double -> Double
- ntpi_utcr :: NTPi -> Double
- utc_base :: UTCTime
- utc_utcr :: UTCTime -> Double
- immediately :: Time
- utcr :: MonadIO m => m Double
- ntpi :: MonadIO m => m NTPi
- pauseThreadLimit :: Double
- pauseThread :: MonadIO m => Double -> m ()
- pauseThreadUntil :: MonadIO m => Double -> m ()
- sleepThread :: MonadIO m => Double -> m ()
- sleepThreadUntil :: MonadIO m => Double -> m ()
Temporal types
Time is represented in either UTC
or NTP
form. The NTP
form may
be either integral or real.
ntpr_utcr :: Double -> DoubleSource
Convert a real-valued NTP timestamp to a real-valued UTC timestamp.
Constant indicating the bundle is to be executed immediately.
Clock operations
Thread operations.
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 :: MonadIO m => Double -> m ()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 :: MonadIO m => Double -> m ()Source
Pause current thread until the given real-valued UTC
time, see
pauseThreadLimit
.
sleepThread :: MonadIO m => Double -> m ()Source
Sleep current thread for the indicated duration (in seconds).
Divides long sleeps into parts smaller than pauseThreadLimit
.
sleepThreadUntil :: MonadIO m => Double -> m ()Source
Sleep current thread until the given real-valued UTC
time.
Divides long sleeps into parts smaller than pauseThreadLimit
.