Fix win32 native_clock() by converting native performance counter value to nanoseconds using previously gotten frequency value

This commit is contained in:
Lexi Allen
2024-08-08 15:10:40 -04:00
committed by Christoffer Lerno
parent 7c8acbe485
commit 07e7bc0a94

View File

@@ -17,7 +17,7 @@ fn Clock native_clock()
}
Win32_LARGE_INTEGER counter @noinit;
if (!win32_QueryPerformanceCounter(&counter)) return 0;
return (Clock)counter.quadPart;
return (Clock)((counter.quadPart * 1_000_000_000) / freq.quadPart);
}
fn Time native_timestamp()