mirror of
https://github.com/wolfpld/tracy
synced 2025-05-01 13:13:53 +00:00
Make instrumented statistics percentages relative to time range.
This commit is contained in:
parent
5559cb0fde
commit
b9a810827d
@ -11908,6 +11908,17 @@ void View::DrawStatistics()
|
|||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
ImGui::PopStyleVar();
|
ImGui::PopStyleVar();
|
||||||
|
|
||||||
|
int64_t timeRange;
|
||||||
|
if( m_statRange.active )
|
||||||
|
{
|
||||||
|
const auto st = m_statRange.max - m_statRange.min;
|
||||||
|
timeRange = st == 0 ? 1 : st;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
timeRange = m_worker.GetLastTime();
|
||||||
|
}
|
||||||
|
|
||||||
if( m_statMode == 0 )
|
if( m_statMode == 0 )
|
||||||
{
|
{
|
||||||
if( srcloc.empty() )
|
if( srcloc.empty() )
|
||||||
@ -11943,7 +11954,6 @@ void View::DrawStatistics()
|
|||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
|
|
||||||
const auto lastTime = m_worker.GetLastTime();
|
|
||||||
for( auto& v : srcloc )
|
for( auto& v : srcloc )
|
||||||
{
|
{
|
||||||
ImGui::PushID( v.srcloc );
|
ImGui::PushID( v.srcloc );
|
||||||
@ -11986,7 +11996,7 @@ void View::DrawStatistics()
|
|||||||
ImGui::TextUnformatted( TimeToString( time ) );
|
ImGui::TextUnformatted( TimeToString( time ) );
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
char buf[64];
|
char buf[64];
|
||||||
PrintStringPercent( buf, 100. * time / lastTime );
|
PrintStringPercent( buf, 100. * time / timeRange );
|
||||||
TextDisabledUnformatted( buf );
|
TextDisabledUnformatted( buf );
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
ImGui::TextUnformatted( RealToString( v.numZones ) );
|
ImGui::TextUnformatted( RealToString( v.numZones ) );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user