HomePhabricator

Add time helpers for std::chrono::steady_clock, Remove unused GetTimeSeconds

Description

Add time helpers for std::chrono::steady_clock, Remove unused GetTimeSeconds

Summary:

Add time helpers for std::chrono::steady_clock

random: Add FastRandomContext::rand_uniform_delay

Remove unused GetTimeSeconds

Seems confusing to have this helper when it is possible to get the system time in a type-safe way by simply calling std::chrono::system_clock::now (C++11).

This patch replaces GetTimeSeconds and removes it:

  • in bitcoin-cli.cpp by system_clock
  • in test/fuzz/fuzz.cpp by steady_clock

This is a backport of core#24921 and core#25102

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D13988

Details

Provenance
MarcoFalke <falke.marco@gmail.com>Authored on Apr 19 2022, 11:13
PiRKCommitted on Jun 7 2023, 06:01
PiRKPushed on Jun 7 2023, 06:01
Reviewer
Restricted Project
Differential Revision
D13988: Add time helpers for std::chrono::steady_clock, Remove unused GetTimeSeconds
Parents
rABC20c41a4f309d: [ecash-opreturn] New npm library for parsing OP_RETURN in ecash app dev
Branches
Unknown
Tags
Unknown