mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-02 12:48:14 +00:00
Begin migration from sys/win32 to sys/windows
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
package time
|
||||
|
||||
import "core:sys/win32"
|
||||
import win32 "core:sys/windows"
|
||||
|
||||
IS_SUPPORTED :: true;
|
||||
|
||||
now :: proc() -> Time {
|
||||
file_time: win32.Filetime;
|
||||
file_time: win32.FILETIME;
|
||||
|
||||
win32.get_system_time_as_file_time(&file_time);
|
||||
win32.GetSystemTimeAsFileTime(&file_time);
|
||||
|
||||
ft := i64(u64(file_time.lo) | u64(file_time.hi) << 32);
|
||||
ft := i64(u64(file_time.dwLowDateTime) | u64(file_time.dwHighDateTime) << 32);
|
||||
|
||||
ns := (ft - 0x019db1ded53e8000) * 100;
|
||||
return Time{_nsec=ns};
|
||||
}
|
||||
|
||||
sleep :: proc(d: Duration) {
|
||||
win32.sleep(u32(d/Millisecond));
|
||||
win32.Sleep(win32.DWORD(d/Millisecond));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user