Skip to content

Commit fa360b0

Browse files
author
MarcoFalke
committed
util: Use SteadyClock in RandAddSeedPerfmon
1 parent 0bd2bd1 commit fa360b0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/randomenv.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ void RandAddSeedPerfmon(CSHA512& hasher)
6969

7070
// This can take up to 2 seconds, so only do it every 10 minutes.
7171
// Initialize last_perfmon to 0 seconds, we don't skip the first call.
72-
static std::atomic<std::chrono::seconds> last_perfmon{0s};
72+
static std::atomic<SteadyClock::time_point> last_perfmon{SteadyClock::time_point{0s}};
7373
auto last_time = last_perfmon.load();
74-
auto current_time = GetTime<std::chrono::seconds>();
75-
if (current_time < last_time + std::chrono::minutes{10}) return;
74+
auto current_time = SteadyClock::now();
75+
if (current_time < last_time + 10min) return;
7676
last_perfmon = current_time;
7777

7878
std::vector<unsigned char> vData(250000, 0);

0 commit comments

Comments
 (0)