Copyright | (c) 2017 Composewell Technologies |
---|---|
License | BSD3 |
Maintainer | streamly@composewell.com |
Stability | experimental |
Portability | GHC |
Safe Haskell | None |
Language | Haskell2010 |
Deprecated: Please use the "rate" combinator instead of the functions in this module
Time utilities for reactive programming.
Documentation
periodic :: Int -> IO () -> IO () Source #
Run an action forever periodically at the given frequency specified in per second (Hz).
Since: 0.1.0
withClock :: IO Int -> Int -> (Int -> IO ()) -> IO () Source #
Run a computation on every clock tick, the clock runs at the specified frequency. It allows running a computation at high frequency efficiently by maintaining a local clock and adjusting it with the provided base clock at longer intervals. The first argument is a base clock returning some notion of time in microseconds. The second argument is the frequency in per second (Hz). The third argument is the action to run, the action is provided the local time as an argument.
Since: 0.1.0