Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 878 Bytes

README.md

File metadata and controls

21 lines (16 loc) · 878 Bytes

async-timer Hackage version Stackage version Build Status

About

This is a lightweight package built on top of the async package providing easy to use periodic timers. This can be used for executing IO actions periodically.

Example:

main :: IO ()
main = do
      let conf = defaultConf & setInitDelay  500 -- 500 ms
                             & setInterval  1000 -- 1 s

      withAsyncTimer conf $ \ timer -> do
        forM_ [1..10] $ \_ -> do
          wait timer
          putStrLn "Tick"