From 28c37ba244cc8bbc090e304206bc082668165f20 Mon Sep 17 00:00:00 2001 From: JCW Date: Wed, 28 May 2025 12:32:43 +0100 Subject: [PATCH] Add cpu counter --- include/xrpl/beast/core/FunctionProfiler.h | 2 +- include/xrpl/beast/hash/xxhasher.h | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/include/xrpl/beast/core/FunctionProfiler.h b/include/xrpl/beast/core/FunctionProfiler.h index 6d6084d12f..d3ca0e43a4 100644 --- a/include/xrpl/beast/core/FunctionProfiler.h +++ b/include/xrpl/beast/core/FunctionProfiler.h @@ -82,7 +82,7 @@ getProfilingResults() times.reserve(duration.time.size()); std::transform(std::begin(duration.time), std::end(duration.time), std::back_inserter(times), [](std::int64_t a, const std::chrono::nanoseconds& time) { - return time.count(); + return static_cast(time.count()); }); auto timeInTotal = std::accumulate(std::begin(times), std::end(times), std::int64_t{0}); diff --git a/include/xrpl/beast/hash/xxhasher.h b/include/xrpl/beast/hash/xxhasher.h index 1345d46254..b62af9907a 100644 --- a/include/xrpl/beast/hash/xxhasher.h +++ b/include/xrpl/beast/hash/xxhasher.h @@ -149,12 +149,6 @@ public: // auto ret = XXH3_64bits_digest(wrapper.state); duration_ += std::chrono::steady_clock::now() - start; - if (FunctionProfiler::funcionDurations - ["xxhasher-" + std::to_string(totalSize_)] - .count == std::numeric_limits::max()) - { - return ret; - } std::lock_guard lock{FunctionProfiler::mutex_}; FunctionProfiler::funcionDurations ["xxhasher-" + std::to_string(totalSize_)]