mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
Merge bitcoin/bitcoin#25499: Use steady clock for all millis bench logging
fa521c9603Use steady clock for all millis bench logging (MacroFake) Pull request description: Currently `GetTimeMillis` is used for bench logging in milliseconds integral precision. Replace it to use a steady clock that is type-safe and steady. Microsecond or float precision can be done in a follow-up. ACKs for top commit: fanquake: ACKfa521c9603- started making the same change. Tree-SHA512: 86a810e496fc663f815acb8771a6c770331593715cde85370226685bc50c13e8e987e3c5efd0b4e48b36ebd2372255357b709204bac750d41e94a9f7d9897fa6
This commit is contained in:
@@ -4319,7 +4319,7 @@ void Chainstate::LoadExternalBlockFile(
|
||||
// Either both should be specified (-reindex), or neither (-loadblock).
|
||||
assert(!dbp == !blocks_with_unknown_parent);
|
||||
|
||||
int64_t nStart = GetTimeMillis();
|
||||
const auto start{SteadyClock::now()};
|
||||
|
||||
int nLoaded = 0;
|
||||
try {
|
||||
@@ -4433,7 +4433,7 @@ void Chainstate::LoadExternalBlockFile(
|
||||
} catch (const std::runtime_error& e) {
|
||||
AbortNode(std::string("System error: ") + e.what());
|
||||
}
|
||||
LogPrintf("Loaded %i blocks from external file in %dms\n", nLoaded, GetTimeMillis() - nStart);
|
||||
LogPrintf("Loaded %i blocks from external file in %dms\n", nLoaded, Ticks<std::chrono::milliseconds>(SteadyClock::now() - start));
|
||||
}
|
||||
|
||||
void Chainstate::CheckBlockIndex()
|
||||
|
||||
Reference in New Issue
Block a user