From 07e7bc0a948b7fa01309648c94f9431c362db576 Mon Sep 17 00:00:00 2001 From: Lexi Allen Date: Thu, 8 Aug 2024 15:10:40 -0400 Subject: [PATCH] Fix win32 native_clock() by converting native performance counter value to nanoseconds using previously gotten frequency value --- lib/std/time/os/time_win32.c3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/time/os/time_win32.c3 b/lib/std/time/os/time_win32.c3 index 212ff59c4..257fd573e 100644 --- a/lib/std/time/os/time_win32.c3 +++ b/lib/std/time/os/time_win32.c3 @@ -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()