Fixed os.sleep not sleeping for long enough with values below 1000ms.
This commit is contained in:
parent
d0bd5d5cc3
commit
9aecfcd8c8
1 changed files with 1 additions and 1 deletions
|
|
@ -1449,7 +1449,7 @@ proc sleep*(milsecs: int) {.rtl, extern: "nos$1", tags: [FTime].} =
|
||||||
else:
|
else:
|
||||||
var a, b: Ttimespec
|
var a, b: Ttimespec
|
||||||
a.tv_sec = TTime(milsecs div 1000)
|
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)
|
discard posix.nanosleep(a, b)
|
||||||
|
|
||||||
proc getFileSize*(file: string): biggestInt {.rtl, extern: "nos$1",
|
proc getFileSize*(file: string): biggestInt {.rtl, extern: "nos$1",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue