2019-06-23 05:21:30 +03:00
|
|
|
// Copyright (c) 2019 Alexander Medvednikov. All rights reserved.
|
|
|
|
// Use of this source code is governed by an MIT license
|
|
|
|
// that can be found in the LICENSE file.
|
|
|
|
|
2019-06-22 21:20:28 +03:00
|
|
|
module time
|
|
|
|
|
2019-06-27 20:02:47 +03:00
|
|
|
// in ms
|
|
|
|
fn ticks() double {
|
|
|
|
return C.GetTickCount()
|
2019-06-22 21:20:28 +03:00
|
|
|
}
|
|
|
|
|
2019-06-27 20:02:47 +03:00
|
|
|
fn sleep(seconds int) {
|
|
|
|
C._sleep(seconds * 1000)
|
2019-06-22 21:20:28 +03:00
|
|
|
}
|
|
|
|
|
2019-06-27 20:02:47 +03:00
|
|
|
fn usleep(seconds int) {
|
|
|
|
panic('usleep not impl')
|
|
|
|
// C._usleep(seconds)
|
2019-06-22 21:20:28 +03:00
|
|
|
}
|
|
|
|
|
2019-06-27 20:02:47 +03:00
|
|
|
fn sleep_ms(n int) {
|
|
|
|
C.Sleep(n)
|
2019-06-22 21:20:28 +03:00
|
|
|
}
|
|
|
|
|