mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Fix win32 native_clock() by converting native performance counter value to nanoseconds using previously gotten frequency value
This commit is contained in:
committed by
Christoffer Lerno
parent
7c8acbe485
commit
07e7bc0a94
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user