Skip to content

Commit a081f97

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 a6b98aa commit a081f97

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
@@ -111,7 +111,7 @@ _dispatch_get_nanoseconds(void)
111111
static const uint64_t kNTToUNIXBiasAdjustment = 11644473600 * NSEC_PER_SEC;
112112
FILETIME ft;
113113
ULARGE_INTEGER li;
114-
GetSystemTimeAsFileTime(&ft);
114+
GetSystemTimePreciseAsFileTime(&ft);
115115
li.LowPart = ft.dwLowDateTime;
116116
li.HighPart = ft.dwHighDateTime;
117117
return li.QuadPart * 100ull - kNTToUNIXBiasAdjustment;

0 commit comments

Comments
 (0)