Fix time.now

This commit is contained in:
gingerBill
2020-06-19 11:35:43 +01:00
parent 9f596d6f34
commit c9d3b95b0d
2 changed files with 13 additions and 6 deletions
+2 -4
View File
@@ -9,11 +9,9 @@ now :: proc() -> Time {
win32.get_system_time_as_file_time(&file_time);
quad := u64(file_time.lo) | u64(file_time.hi) << 32;
ft := i64(u64(file_time.lo) | u64(file_time.hi) << 32);
UNIX_TIME_START :: 0x019db1ded53e8000;
ns := (1e9/1e7)*(i64(quad) - UNIX_TIME_START);
ns := (ft - 0x019db1ded53e8000) * 100;
return Time{_nsec=ns};
}