streamly-0.1.1: Beautiful Streaming, Concurrent and Reactive Composition

Copyright(c) 2017 Harendra Kumar
LicenseBSD3
Maintainerharendra.kumar@gmail.com
Stabilityexperimental
PortabilityGHC
Safe HaskellSafe
LanguageHaskell2010

Streamly.Time

Description

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).

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.