From fa360b047fc578fd855b8f7420d84dc967884f4a Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Mon, 1 Jul 2024 17:47:43 +0200 Subject: [PATCH] util: Use SteadyClock in RandAddSeedPerfmon --- src/randomenv.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/randomenv.cpp b/src/randomenv.cpp index 49033deef267f..93d30a27fdb9a 100644 --- a/src/randomenv.cpp +++ b/src/randomenv.cpp @@ -69,10 +69,10 @@ void RandAddSeedPerfmon(CSHA512& hasher) // This can take up to 2 seconds, so only do it every 10 minutes. // Initialize last_perfmon to 0 seconds, we don't skip the first call. - static std::atomic last_perfmon{0s}; + static std::atomic last_perfmon{SteadyClock::time_point{0s}}; auto last_time = last_perfmon.load(); - auto current_time = GetTime(); - if (current_time < last_time + std::chrono::minutes{10}) return; + auto current_time = SteadyClock::now(); + if (current_time < last_time + 10min) return; last_perfmon = current_time; std::vector vData(250000, 0);