streamly-0.8.3: Dataflow programming and declarative concurrency
Copyright(c) 2017 Composewell Technologies
LicenseBSD3
Maintainerstreamly@composewell.com
Stabilityexperimental
PortabilityGHC
Safe HaskellSafe-Inferred
LanguageHaskell2010

Streamly.Internal.Data.Time

Description

Deprecated: Please use the "rate" combinator instead of the functions in this module

Time utilities for reactive programming.

Synopsis

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