Display zone running time in zone tooltip.

This commit is contained in:
Bartosz Taudul 2019-08-14 17:59:28 +02:00
parent 1ae540c7a1
commit d520f1cc48

View File

@ -11082,6 +11082,22 @@ void View::ZoneTooltip( const ZoneEvent& ev )
ImGui::SameLine(); ImGui::SameLine();
ImGui::TextDisabled( "(%.2f%%)", 100.f * selftime / ztime ); ImGui::TextDisabled( "(%.2f%%)", 100.f * selftime / ztime );
} }
const auto ctx = m_worker.GetContextSwitchData( tid );
if( ctx )
{
int64_t time;
uint64_t cnt;
if( GetZoneRunningTime( ctx, ev, time, cnt ) )
{
TextFocused( "Running state time:", TimeToString( time ) );
if( ztime != 0 )
{
ImGui::SameLine();
ImGui::TextDisabled( "(%.2f%%)", 100.f * time / ztime );
}
TextFocused( "Running state regions:", RealToString( cnt, true ) );
}
}
if( ev.text.active ) if( ev.text.active )
{ {
ImGui::NewLine(); ImGui::NewLine();