aboutsummaryrefslogtreecommitdiff
path: root/src/policy
diff options
context:
space:
mode:
authorMacroFake <falke.marco@gmail.com>2022-10-10 12:00:28 +0200
committerMacroFake <falke.marco@gmail.com>2022-10-10 12:00:34 +0200
commit239757409bd6a966a9dde1288d3b8f2ea932e683 (patch)
tree6dd928b1029bdf9d1e99c78420ae6d908bcdc88a /src/policy
parent866dd664a16de341262b1f1a7bfd46be7eb78a8e (diff)
parentfabf1cdb206e368a9433abf99a5ea2762a5ed2c0 (diff)
downloadbitcoin-239757409bd6a966a9dde1288d3b8f2ea932e683.tar.xz
Merge bitcoin/bitcoin#26118: log: Use steady clock for bench logging
fabf1cdb206e368a9433abf99a5ea2762a5ed2c0 Use steady clock for bench logging (MacroFake) faed342a2338d6a1a26cf977671a736662debae4 scripted-diff: Rename time symbols (MacroFake) Pull request description: Instead of using `0.001` and similar constants to "convert" an int64_t to milliseconds, use the type-safe `Ticks<>` helper. Also, use steady clock instead of system clock, since the durations are used for benchmarking. ACKs for top commit: fanquake: ACK fabf1cdb206e368a9433abf99a5ea2762a5ed2c0 - validation bench output still looks sane. Tree-SHA512: e6525b5fdad6045ca500c56014897d7428ad288aaf375933d3b5939feddf257f6910d562eb66ebcde9186bef9a604ee8d763a318253838318d59df2a285be7c2
Diffstat (limited to 'src/policy')
-rw-r--r--src/policy/fees.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/policy/fees.cpp b/src/policy/fees.cpp
index 2b940be07e..22defb91a9 100644
--- a/src/policy/fees.cpp
+++ b/src/policy/fees.cpp
@@ -997,8 +997,9 @@ bool CBlockPolicyEstimator::Read(AutoFile& filein)
return true;
}
-void CBlockPolicyEstimator::FlushUnconfirmed() {
- int64_t startclear = GetTimeMicros();
+void CBlockPolicyEstimator::FlushUnconfirmed()
+{
+ const auto startclear{SteadyClock::now()};
LOCK(m_cs_fee_estimator);
size_t num_entries = mapMemPoolTxs.size();
// Remove every entry in mapMemPoolTxs
@@ -1006,8 +1007,8 @@ void CBlockPolicyEstimator::FlushUnconfirmed() {
auto mi = mapMemPoolTxs.begin();
_removeTx(mi->first, false); // this calls erase() on mapMemPoolTxs
}
- int64_t endclear = GetTimeMicros();
- LogPrint(BCLog::ESTIMATEFEE, "Recorded %u unconfirmed txs from mempool in %gs\n", num_entries, (endclear - startclear)*0.000001);
+ const auto endclear{SteadyClock::now()};
+ LogPrint(BCLog::ESTIMATEFEE, "Recorded %u unconfirmed txs from mempool in %gs\n", num_entries, Ticks<SecondsDouble>(endclear - startclear));
}
FeeFilterRounder::FeeFilterRounder(const CFeeRate& minIncrementalFee)