From ef9b6202067f46b87ba16fce50b25e49e94a5950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Gawro=C5=84ski?= Date: Sun, 2 Nov 2025 12:52:07 +0100 Subject: [PATCH] Replace GetSystemTimeAsFileTime with GetSystemTimePreciseAsFileTime According to Microsoft documentation this variant of GetSystemTime guarantiees to get highest posible level of precision (<1us). https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsystemtimepreciseasfiletime --- include/boost/thread/detail/platform_time.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/thread/detail/platform_time.hpp b/include/boost/thread/detail/platform_time.hpp index c0e40d65d..968f1d139 100644 --- a/include/boost/thread/detail/platform_time.hpp +++ b/include/boost/thread/detail/platform_time.hpp @@ -294,7 +294,7 @@ inline FP init_steady_clock(kern_return_t & err) { #if defined(BOOST_THREAD_CHRONO_WINDOWS_API) boost::winapi::FILETIME_ ft; - boost::winapi::GetSystemTimeAsFileTime(&ft); // never fails + boost::winapi::GetSystemPreciseTimeAsFileTime(&ft); // never fails boost::time_max_t ns = ((((static_cast(ft.dwHighDateTime) << 32) | ft.dwLowDateTime) - 116444736000000000LL) * 100LL); return real_platform_timepoint(ns); #elif defined(BOOST_THREAD_CHRONO_MAC_API)