From 93308ac57803fdfa90cb24c2f02819e747a3eaef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= <tseeker@nocternity.net>
Date: Thu, 5 Oct 2017 08:32:43 +0200
Subject: [PATCH] Display durations in profiler list

---
 profiling.cc | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/profiling.cc b/profiling.cc
index e4dd40f..64103c4 100644
--- a/profiling.cc
+++ b/profiling.cc
@@ -123,7 +123,7 @@ void T_Profiler::makeUI( )
 			ImGuiSetCond_Once );
 	ImGui::Begin( "Profiler" );
 
-	ImGui::BeginChild( "left" , ImVec2( 150 , 0 ) , true );
+	ImGui::BeginChild( "left" , ImVec2( 180 , 0 ) , true );
 	float angle( 0 );
 	for ( auto i = 0u ; i < n ; i ++ ) {
 		if ( displayed_.size( ) == i ) {
@@ -134,8 +134,12 @@ void T_Profiler::makeUI( )
 		ImGui::ColorConvertHSVtoRGB( angle / 360. , .5 , 1 ,
 			color.x , color.y , color.z );
 		ImGui::PushStyleColor( ImGuiCol_Text , color );
-		ImGui::Checkbox( sections_[ i ].c_str( ) ,
-				(bool*) &displayed_[ i ] );
+
+		std::ostringstream str;
+		str << sections_[ i ] << " ("
+			<< int( round( secDurations_[ i ] ) )
+			<< "ms)";
+		ImGui::Checkbox( str.str( ).c_str( ) , (bool*) &displayed_[ i ] );
 		ImGui::PopStyleColor( );
 	}
 	ImGui::EndChild( );