Clean up core:time to be consistent across all platforms

This commit is contained in:
gingerBill
2022-05-12 15:47:24 +01:00
parent 97739da85a
commit f002857edc
11 changed files with 159 additions and 138 deletions
+4 -5
View File
@@ -1,22 +1,21 @@
//+private
package time
import win32 "core:sys/windows"
IS_SUPPORTED :: true
_IS_SUPPORTED :: true
now :: proc() -> Time {
_now :: proc "contextless" () -> Time {
file_time: win32.FILETIME
win32.GetSystemTimeAsFileTime(&file_time)
ns := win32.FILETIME_as_unix_nanoseconds(file_time)
return Time{_nsec=ns}
}
sleep :: proc(d: Duration) {
_sleep :: proc "contextless" (d: Duration) {
win32.Sleep(win32.DWORD(d/Millisecond))
}
_tick_now :: proc "contextless" () -> Tick {
mul_div_u64 :: proc "contextless" (val, num, den: i64) -> i64 {
q := val / den