úÎW(SafeCreate a new ticker.0import Control.Concurrent.Chan (getChanContents)import Control.Monad (forM_)import System.Timeout (timeout).(chan, cancelTicker) <- newTicker $ 10^3 * 100"chanStream <- getChanContents chanC_ <- timeout (10^3 * 350) $ forM_ chanStream (\_ -> putStr "Tick!")Tick!Tick!Tick! cancelTickerCreate a new ticker and pass a Chan ()Y of the ticker to the supplied function. The ticker thread will be closed automatically.0import Control.Concurrent.Chan (getChanContents)import Control.Monad (forM_)import System.Timeout (timeout):{%withTicker (10^3 * 100) $ \chan -> do$ chanStream <- getChanContents chanE _ <- timeout (10^3 * 350) $ forM_ chanStream (\_ -> putStr "Tick!") return ():}Tick!Tick!Tick!A variant of the  that uses  getCPUTime instead of  threadDelay internally.ticker rate by micro sec!ticker channel and ticker stopperticker rate by micro sechandler functionresult of handler#ticker-1.0.0-G7qa3MFq77LC7b4saaSoaUControl.Concurrent.Ticker newTicker withTickernewCPUTimeTicker