Fixed missing register move in if statements
This commit is contained in:
@ -4,18 +4,14 @@ import sys
|
||||
sleep(nanoseconds Int) {
|
||||
seconds := 0
|
||||
|
||||
loop {
|
||||
if nanoseconds >= 1000000000 {
|
||||
nanoseconds = nanoseconds - 1000000000
|
||||
seconds += 1
|
||||
} else {
|
||||
timespec := mem.alloc(16)
|
||||
store(timespec, 8, seconds)
|
||||
offset := timespec + 8
|
||||
store(offset, 8, nanoseconds)
|
||||
sys.nanosleep(timespec)
|
||||
mem.free(timespec, 16)
|
||||
return
|
||||
}
|
||||
if nanoseconds >= 1000000000 {
|
||||
seconds, nanoseconds = nanoseconds / 1000000000
|
||||
}
|
||||
|
||||
timespec := mem.alloc(16)
|
||||
store(timespec, 8, seconds)
|
||||
offset := timespec + 8
|
||||
store(offset, 8, nanoseconds)
|
||||
sys.nanosleep(timespec)
|
||||
mem.free(timespec, 16)
|
||||
}
|
Reference in New Issue
Block a user