Display zone self time.

This commit is contained in:
Bartosz Taudul 2019-01-23 13:44:11 +01:00
parent 06292f1a3f
commit 3d2cc2d54d

View File

@ -3844,8 +3844,12 @@ void View::DrawZoneInfoWindow()
const auto end = m_worker.GetZoneEnd( ev ); const auto end = m_worker.GetZoneEnd( ev );
const auto ztime = end - ev.start; 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( "Time from start of program:", TimeToString( ev.start - m_worker.GetTimeBegin() ) );
TextFocused( "Execution time:", TimeToString( ztime ) ); TextFocused( "Execution time:", TimeToString( ztime ) );
TextFocused( "Self time:", TimeToString( selftime ) );
ImGui::SameLine();
ImGui::TextDisabled( "(%.2f%%)", 100.f * selftime / ztime );
if( ImGui::IsItemHovered() ) if( ImGui::IsItemHovered() )
{ {
ImGui::BeginTooltip(); ImGui::BeginTooltip();
@ -8383,6 +8387,8 @@ void View::ZoneTooltip( const ZoneEvent& ev )
const auto tid = GetZoneThread( ev ); const auto tid = GetZoneThread( ev );
auto& srcloc = m_worker.GetSourceLocation( ev.srcloc ); auto& srcloc = m_worker.GetSourceLocation( ev.srcloc );
const auto end = m_worker.GetZoneEnd( ev ); const auto end = m_worker.GetZoneEnd( ev );
const auto ztime = end - ev.start;
const auto selftime = ztime - GetZoneChildTime( ev );
ImGui::BeginTooltip(); ImGui::BeginTooltip();
if( ev.name.active ) if( ev.name.active )
@ -8400,7 +8406,10 @@ void View::ZoneTooltip( const ZoneEvent& ev )
ImGui::SameLine(); ImGui::SameLine();
ImGui::TextDisabled( "(0x%" PRIX64 ")", tid ); ImGui::TextDisabled( "(0x%" PRIX64 ")", tid );
ImGui::Separator(); 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 ) if( ev.cpu_start >= 0 )
{ {
ImGui::TextDisabled( "CPU:" ); ImGui::TextDisabled( "CPU:" );