Skip to content

sleep fails for compiled program

For the following program, runghc or ghci produces a list of numbers with a delay between printing each number. But when I run the compiled program, there is no delay.

import System.Posix
main = loop 10
loop 0 = print "done"
loop n = do
  print n
  sleep 3
  loop $ n - 1
Edited by Ian Lynagh -
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information