diff options
Diffstat (limited to 'src/randomenv.cpp')
-rw-r--r-- | src/randomenv.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/randomenv.cpp b/src/randomenv.cpp index 49033deef2..dee48481c5 100644 --- a/src/randomenv.cpp +++ b/src/randomenv.cpp @@ -3,7 +3,7 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include <config/bitcoin-config.h> // IWYU pragma: keep +#include <bitcoin-build-config.h> // IWYU pragma: keep #include <randomenv.h> @@ -58,7 +58,9 @@ #include <sys/auxv.h> #endif +#ifndef _MSC_VER extern char** environ; // NOLINT(readability-redundant-declaration): Necessary on some platforms +#endif namespace { @@ -69,10 +71,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<std::chrono::seconds> last_perfmon{0s}; + static std::atomic<SteadyClock::time_point> last_perfmon{SteadyClock::time_point{0s}}; auto last_time = last_perfmon.load(); - auto current_time = GetTime<std::chrono::seconds>(); - 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<unsigned char> vData(250000, 0); |