From 1bb7d05ba0b0ac4f4db9a65321271f29f3c218eb Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 14 Mar 2020 01:47:18 +0100 Subject: [PATCH] Display time percentage in statistics menu. --- server/TracyView.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 731a46ff..9772c790 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -11156,6 +11156,7 @@ void View::DrawStatistics() ImGui::NextColumn(); ImGui::Separator(); + const auto lastTime = m_worker.GetLastTime(); for( auto& v : srcloc ) { ImGui::PushID( v->first ); @@ -11193,7 +11194,12 @@ void View::DrawStatistics() ImGui::Unindent( indentVal ); } ImGui::NextColumn(); - ImGui::TextUnformatted( TimeToString( m_statSelf ? v->second.selfTotal : v->second.total ) ); + const auto time = m_statSelf ? v->second.selfTotal : v->second.total; + ImGui::TextUnformatted( TimeToString( time ) ); + ImGui::SameLine(); + char buf[64]; + PrintStringPercent( buf, 100. * time / lastTime ); + TextDisabledUnformatted( buf ); ImGui::NextColumn(); ImGui::TextUnformatted( RealToString( v->second.zones.size() ) ); ImGui::NextColumn();