From 0a3df2687335ece445d5aa2a0959d938c36dca8e Mon Sep 17 00:00:00 2001 From: lisyarus Date: Fri, 5 Aug 2022 17:34:25 +0300 Subject: [PATCH] Show relative time percentage in profiler output --- libs/prof/source/profiler.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/prof/source/profiler.cpp b/libs/prof/source/profiler.cpp index 86d2201b..29a05931 100644 --- a/libs/prof/source/profiler.cpp +++ b/libs/prof/source/profiler.cpp @@ -102,7 +102,8 @@ namespace psemek::prof << " 25% " << pretty(stat.percentile(0.25)) << " 50% " << pretty(stat.percentile(0.50)) << " 75% " << pretty(stat.percentile(0.75)) - << " (" << stat.count() << " calls, " << std::setprecision(3) << (stat.count() * 1.f / node.execution_time.count() * 1.f) << "x)"; + << " (" << stat.count() << " calls, " << std::setprecision(3) << (stat.count() * 1.f / node.execution_time.count() * 1.f) << "x, " + << std::setprecision(2) << (100.f * stat.count() * stat.mean() / node.execution_time.mean() / node.execution_time.count()) << "%)"; else log::info() << std::string(depth * 2, ' ') << std::setw(max_name_length + 3) << std::left << std::setfill(' ') << c.first << " avg " << pretty(stat.mean())