moduleHappstack.Util.Cron(cron)whereimportControl.Concurrent(threadDelay)typeSeconds=Int-- | Given an action f and a number of seconds t, cron will execute-- f every t seconds with the first execution t seconds after cron is called.-- cron does not spawn a new thread.cron::Seconds->IO()->IOacronseconds0action=loopseconds0wheremaxSeconds=(maxBound::Int)`div`10^(6::Int)loopseconds=ifseconds<=maxSecondsthendothreadDelay(10^(6::Int)*seconds)actionloopseconds0elsedothreadDelay(10^(6::Int)*maxSeconds)loop(seconds-maxSeconds)