Safe Haskell | Safe-Infered |
---|
- data Timer m
- type TimerIO = Timer IO
- oneShotTimer :: MonadBaseControl IO m => Delay -> m () -> m (Timer m)
- oneShotRestart :: MonadBaseControl IO m => Timer m -> m Bool
- repeatedTimer :: MonadBaseControl IO m => Delay -> m () -> m (Timer m)
- repeatedRestart :: MonadBaseControl IO m => Timer m -> m Bool
- newTimer :: MonadBase IO m => Delay -> m () -> m (Timer m)
- stopTimer :: MonadBaseControl IO m => Timer m -> m ()
Documentation
The data type representing the timer. For now, the action and delay are fixed for the lifetime of the Timer.
:: MonadBaseControl IO m | |
=> Delay | The (minimal) time until the execution in microseconds. |
-> m () | The action to be executed. |
-> m (Timer m) |
Executes the the given action once after the given delay elapsed, no sooner, maybe later.
oneShotRestart :: MonadBaseControl IO m => Timer m -> m BoolSource
Attempts to restart (or start) a timer making it a one shot timer.
Returns True if the restrat was successful, otherwise (e.g. other thread is attempting to restart the timer) returns False.
:: MonadBaseControl IO m | |
=> Delay | The (minimal) delay between executions. |
-> m () | The action to be executed. |
-> m (Timer m) |
Executes the the given action repeatedly with at least the given delay between executions.
repeatedRestart :: MonadBaseControl IO m => Timer m -> m BoolSource
Attempts to restart (or start) a timer making it a repeated timer.
Returns True if the restrat was successful, otherwise (e.g. other thread is attempting to restart the timer) returns False.