mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
time: fix sleep() on windows
This commit is contained in:
parent
3a2d696fac
commit
e6b4f9ff09
@ -214,6 +214,12 @@ pub struct C.timeval {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// wait makes the calling thread sleep for a given duration (in nanoseconds).
|
// wait makes the calling thread sleep for a given duration (in nanoseconds).
|
||||||
|
[deprecated: 'call time.sleep(n * time.second)']
|
||||||
pub fn wait(duration Duration) {
|
pub fn wait(duration Duration) {
|
||||||
C.Sleep(int(duration / millisecond))
|
C.Sleep(int(duration / millisecond))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// sleep makes the calling thread sleep for a given duration (in nanoseconds).
|
||||||
|
pub fn sleep(duration Duration) {
|
||||||
|
C.Sleep(int(duration / millisecond))
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user