diff --git a/libs/util/source/profiler.cpp b/libs/util/source/profiler.cpp index 9bc4ebde..02d184b3 100644 --- a/libs/util/source/profiler.cpp +++ b/libs/util/source/profiler.cpp @@ -79,12 +79,17 @@ namespace psemek::util for (auto const & c : node.children) { auto const & stat = c.second.execution_time; - log::info() << std::string(depth * 2, ' ') << std::setw(max_name_length + 3) << std::left << std::setfill(' ') << c.first - << " avg " << pretty(stat.mean()) - << " 25% " << pretty(stat.percentile(0.25)) - << " 50% " << pretty(stat.percentile(0.50)) - << " 75% " << pretty(stat.percentile(0.75)) - << " (" << stat.count() << " calls)"; + if (stat.count() == 1) + log::info() << std::string(depth * 2, ' ') << std::setw(max_name_length + 3) << std::left << std::setfill(' ') << c.first + << " " << pretty(stat.mean()) + << " (" << stat.count() << " call)"; + else + log::info() << std::string(depth * 2, ' ') << std::setw(max_name_length + 3) << std::left << std::setfill(' ') << c.first + << " avg " << pretty(stat.mean()) + << " 25% " << pretty(stat.percentile(0.25)) + << " 50% " << pretty(stat.percentile(0.50)) + << " 75% " << pretty(stat.percentile(0.75)) + << " (" << stat.count() << " calls)"; dump_impl(c.second, depth + 1); } }