From 8e001367bec2ba4c0e6bb0b139a0e9d7d06528d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Gawro=C5=84ski?= Date: Sun, 2 Nov 2025 12:55:57 +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/date_time/microsec_time_clock.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/date_time/microsec_time_clock.hpp b/include/boost/date_time/microsec_time_clock.hpp index 42a918b53..ab36b72a8 100644 --- a/include/boost/date_time/microsec_time_clock.hpp +++ b/include/boost/date_time/microsec_time_clock.hpp @@ -88,7 +88,7 @@ namespace date_time { boost::uint32_t sub_sec = tv.tv_usec; #elif defined(BOOST_HAS_FTIME) boost::winapi::FILETIME_ ft; - boost::winapi::GetSystemTimeAsFileTime(&ft); + boost::winapi::GetSystemTimePreciseAsFileTime(&ft); #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205)) // Some runtime library implementations expect local times as the norm for ctime functions. {