HomePhabricator

util: Use steady clock instead of system clock to measure durations

Description

util: Use steady clock instead of system clock to measure durations

Summary:
GetTimeMillis has multiple issues:

  • It doesn't denote the underlying clock type
  • It isn't type-safe
  • It is used incorrectly in places that should use a steady clock

Fix all issues here.

refactor, qt: Use std::chrono for MODEL_UPDATE_DELAY constant

https://github.com/bitcoin-core/gui/pull/517/commits/33d520ac538fcd6285fd958578f1bd26295592e4

net: Use steady clock in InterruptibleRecv

test: Use steady clock in index tests

See D14087 for why 30s in blockfilter_index_tests

wallet: Use steady clock to measure scanning duration

wallet: Use steady clock to calculate number of derive iterations

with MillisecondsDouble from core#26118

This is a backport of core#27405 and a partial backport of core-gui#517

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>Authored on Jan 6 2022, 16:25
PiRKCommitted on Jul 16 2025, 13:50
PiRKPushed on Jul 16 2025, 13:50
Reviewer
Restricted Project
Differential Revision
D18365: util: Use steady clock instead of system clock to measure durations
Parents
rABC43e9859473bf: [cashtab-faucet] Use the right var name
Branches
Unknown
Tags
Unknown