From 3d2cc2d54de29e4656562ce9c63f6b93a7e739aa Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 23 Jan 2019 13:44:11 +0100 Subject: [PATCH] Display zone self time. --- server/TracyView.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 19bdb268..ce0de085 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -3844,8 +3844,12 @@ void View::DrawZoneInfoWindow() const auto end = m_worker.GetZoneEnd( ev ); const auto ztime = end - ev.start; + const auto selftime = ztime - GetZoneChildTime( ev ); TextFocused( "Time from start of program:", TimeToString( ev.start - m_worker.GetTimeBegin() ) ); TextFocused( "Execution time:", TimeToString( ztime ) ); + TextFocused( "Self time:", TimeToString( selftime ) ); + ImGui::SameLine(); + ImGui::TextDisabled( "(%.2f%%)", 100.f * selftime / ztime ); if( ImGui::IsItemHovered() ) { ImGui::BeginTooltip(); @@ -8383,6 +8387,8 @@ void View::ZoneTooltip( const ZoneEvent& ev ) const auto tid = GetZoneThread( ev ); auto& srcloc = m_worker.GetSourceLocation( ev.srcloc ); const auto end = m_worker.GetZoneEnd( ev ); + const auto ztime = end - ev.start; + const auto selftime = ztime - GetZoneChildTime( ev ); ImGui::BeginTooltip(); if( ev.name.active ) @@ -8400,7 +8406,10 @@ void View::ZoneTooltip( const ZoneEvent& ev ) ImGui::SameLine(); ImGui::TextDisabled( "(0x%" PRIX64 ")", tid ); ImGui::Separator(); - TextFocused( "Execution time:", TimeToString( end - ev.start ) ); + TextFocused( "Execution time:", TimeToString( ztime ) ); + TextFocused( "Self time:", TimeToString( selftime ) ); + ImGui::SameLine(); + ImGui::TextDisabled( "(%.2f%%)", 100.f * selftime / ztime ); if( ev.cpu_start >= 0 ) { ImGui::TextDisabled( "CPU:" );