Update profiler

This commit is contained in:
JCW
2025-05-21 16:54:39 +01:00
parent f85432aee4
commit 95b9a77126
2 changed files with 3 additions and 3 deletions

View File

@@ -19,7 +19,7 @@ class FunctionProfiler
public:
inline static std::unordered_map<std::string, std::chrono::nanoseconds> funcionDurations;
FunctionProfiler(std::source_location location = std::source_location::current()): functionName(location.function_name()), start(std::chrono::steady_clock::now())
FunctionProfiler(const std::string& tag, std::source_location location = std::source_location::current()): functionName(location.function_name() + tag), start(std::chrono::steady_clock::now())
{
}

View File

@@ -89,14 +89,14 @@ public:
void
operator()(void const* key, std::size_t len) noexcept
{
FunctionProfiler _;
FunctionProfiler _{"-size-" + std::to_string(len)};
XXH3_64bits_update(state_, key, len);
}
explicit
operator std::size_t() noexcept
{
FunctionProfiler _;
FunctionProfiler _{"-digest"};
return XXH3_64bits_digest(state_);
}
};