Fixed os.sleep not sleeping for long enough with values below 1000ms.

This commit is contained in:
Dominik Picheta
2013-01-21 14:20:54 +00:00
parent d0bd5d5cc3
commit 9aecfcd8c8

View File

@@ -1449,7 +1449,7 @@ proc sleep*(milsecs: int) {.rtl, extern: "nos$1", tags: [FTime].} =
else:
var a, b: Ttimespec
a.tv_sec = TTime(milsecs div 1000)
a.tv_nsec = (milsecs mod 1000) * 1000
a.tv_nsec = (milsecs mod 1000) * 1000 * 1000
discard posix.nanosleep(a, b)
proc getFileSize*(file: string): biggestInt {.rtl, extern: "nos$1",