Skip to content

Commit 3d176b3

Browse files
committed
time: use GetSystemTimePreceiseAsFileTime on Windows
Use the `GetSystemTimePreciseAsFileTime` rather than `GetSystemTimeAsFileTime` as we may otherwise get a cached value from the last context switch.
1 parent 3d7b22e commit 3d176b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/shims/time.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ _dispatch_get_nanoseconds(void)
112112
// FILETIME is 100-nanosecond intervals since January 1, 1601 (UTC).
113113
FILETIME ft;
114114
ULARGE_INTEGER li;
115-
GetSystemTimeAsFileTime(&ft);
115+
GetSystemTimePreciseAsFileTime(&ft);
116116
li.LowPart = ft.dwLowDateTime;
117117
li.HighPart = ft.dwHighDateTime;
118118
return li.QuadPart * 100ull - kNTToUNIXBiasAdjustment;

0 commit comments

Comments
 (0)