From d4d28e841a216e37d1b7fa821ca2d9bbaa16fe89 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 29 Sep 2017 22:06:31 +0200 Subject: [PATCH] Display basic timing info. --- server/TracyView.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index a13f477d..c1e80349 100755 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -1266,16 +1266,23 @@ int View::DrawZoneLevel( const Vector& vec, bool hover, double pxns, con void View::DrawZoneInfoWindow() { if( !m_zoneInfoWindow ) return; + auto& ev = *m_zoneInfoWindow; + int dmul = 1; + bool show = true; ImGui::Begin( "Zone info", &show, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_ShowBorders ); if( ImGui::Button( "Zoom to zone" ) ) { ZoomToZone( ev ); } + + ImGui::Separator(); + if( ev.text && ev.text->zoneName ) { ImGui::Text( "Zone name: %s", GetString( ev.text->zoneName ) ); + dmul++; } auto& srcloc = GetSourceLocation( ev.srcloc ); ImGui::Text( "Function: %s", GetString( srcloc.function ) ); @@ -1283,8 +1290,17 @@ void View::DrawZoneInfoWindow() if( ev.text && ev.text->userText ) { ImGui::Text( "User text: %s", ev.text->userText ); + dmul++; } + + ImGui::Separator(); + + const auto end = GetZoneEnd( ev ); + ImGui::Text( "Time from start of program: %s", TimeToString( ev.start - m_frames[0] ) ); + ImGui::Text( "Execution time: %s", TimeToString( end - ev.start ) ); + ImGui::Text( "Without profiling: %s", TimeToString( end - ev.start - m_delay * dmul ) ); ImGui::End(); + if( !show ) m_zoneInfoWindow = nullptr; }