box-0.6.0: boxes

Safe HaskellNone
LanguageHaskell2010

Box.Time

Description

timing effects

Synopsis

Documentation

sleep :: MonadConc m => Double -> m () Source #

sleep for x seconds

sleepUntil :: UTCTime -> IO () Source #

sleep until a certain time (in the future)

data Stamped a Source #

A value with a UTCTime annotation.

Constructors

Stamped 

Fields

Instances
Eq a => Eq (Stamped a) Source # 
Instance details

Defined in Box.Time

Methods

(==) :: Stamped a -> Stamped a -> Bool #

(/=) :: Stamped a -> Stamped a -> Bool #

Read a => Read (Stamped a) Source # 
Instance details

Defined in Box.Time

Show a => Show (Stamped a) Source # 
Instance details

Defined in Box.Time

Methods

showsPrec :: Int -> Stamped a -> ShowS #

show :: Stamped a -> String #

showList :: [Stamped a] -> ShowS #

stampNow :: (MonadConc m, MonadIO m) => a -> m (LocalTime, a) Source #

Add the current time

stampE :: (MonadConc m, MonadIO m) => Emitter m a -> Emitter m (LocalTime, a) Source #

adding a time stamp

emitOn :: Emitter IO (LocalTime, a) -> Emitter IO a Source #

wait until Stamped time before emitting

playback :: Double -> Emitter IO (LocalTime, a) -> IO (Emitter IO (LocalTime, a)) Source #

reset the emitter stamps to by in sync with the current time and adjust the speed >>> let e1 = fromListE (zipWith (x a -> Stamped (addUTCTime (fromDouble x) t) a) [0..5] [0..5])

simulate :: Double -> Emitter IO (LocalTime, a) -> Cont IO (Emitter IO a) Source #

simulate a delay from a (Stamped a) Emitter relative to the first timestamp