<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div>(<a href="tel:86400000000">86400000000</a> :: Integer) > (fromIntegral (maxBound :: Int))</div><div><br></div><div>If True, your machine (32-bit?) is probably overflowing the Int</div><div><br></div><div>Tom</div><div><br></div><div><br>El 28 dic 2016, a las 08:20, Lian Hung Hon <<a href="mailto:hon.lianhung@gmail.com">hon.lianhung@gmail.com</a>> escribió:<br><br></div><blockquote type="cite"><div><div dir="ltr">Dear Haskellers,<br><br>I am baffled by a strange bug (?) with threadDelay on Windows. It delays for less time than expected (500 seconds vs expected 24 hours), and is consistently reproducible on my system. Can someone have a look (need some patience, ~8 minutes waiting), just to be sure? I glanced around trac but didn't find any related issues.<br><br>How to reproduce:<br><br>module Main where<br><br>import Data.Time<br>import Control.Concurrent<br>import Control.Monad<br><br>main :: IO ()<br>main = do<br> _ <- forkIO thread<br> getLine >>= print -- Just to keep the main thread running<br><br>thread :: IO ()<br>thread = forever $ do<br> now <- getCurrentTime<br> print now<br> threadDelay 86400000000<br> print "done waiting"<br><br><br>Expected result:<br>2016-12-28 13:07:49.5113098 UTC<br>...<br>(next timing should be the next day 2016-12-29)<br><br><br>Actual result:<br>2016-12-28 13:07:49.5113098 UTC<br>"done waiting"<br>2016-12-28 13:16:10.2159485 UTC<br>"done waiting"<br>2016-12-28 13:24:30.8735845 UTC<br>"done waiting"<br>2016-12-28 13:32:51.5292203 UTC<br>...<br><br><br>System: Windows 7 Enterprise Service Pack 1, ghc 7.10.3<br><br><br>This seems specific to Windows, it doesn't appear on Debian 8. Help is appreciated!<br><br><br>Regards,<br>Hon<br><br>Rant: It has cost me significant debugging time! Please tell me I made a rookie mistake or misread the docs somewhere!<br></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Haskell-Cafe mailing list</span><br><span>To (un)subscribe, modify options or view archives go to:</span><br><span><a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a></span><br><span>Only members subscribed via the mailman list are allowed to post.</span></div></blockquote></body></html>