> Wasn't the conclusion that OS.Process.sleep had to loop if > nanosleep() returned with time left? Yes. I believe that's what this code does. fun sleep t = if Time.<= (t, Time.zeroTime) then () else sleep (Posix.Process.sleep t)