From 4ee8e7c372013513fbf165739638eb8fd48551be Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 31 Aug 2018 18:43:25 +0200 Subject: [PATCH] Also display frames per second for average and median frame times. --- server/TracyView.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index ce21d6ce..43a62614 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -6367,11 +6367,18 @@ void View::DrawInfo() } pdqsort_branchless( data.begin(), data.end() ); + const auto average = float( total ) / fsz; + const auto median = data[fsz/2]; + ImGui::Separator(); TextFocused( "Frame set:", m_frames->name == 0 ? "Frames" : m_worker.GetString( m_frames->name ) ); TextFocused( "Count:", RealToString( fsz, true ) ); - TextFocused( "Average frame time:", TimeToString( float( total ) / fsz ) ); - TextFocused( "Median frame time:", TimeToString( data[fsz/2] ) ); + TextFocused( "Average frame time:", TimeToString( average ) ); + ImGui::SameLine(); + ImGui::TextDisabled( "(%s FPS)", RealToString( round( 1000000000.0 / average ), true ) ); + TextFocused( "Median frame time:", TimeToString( median ) ); + ImGui::SameLine(); + ImGui::TextDisabled( "(%s FPS)", RealToString( round( 1000000000.0 / median ), true ) ); } ImGui::Separator(); TextFocused( "Host info:", m_worker.GetHostInfo().c_str() );