From 6a500ccdb3c0840b95281449eb32194bbd47bd73 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 5 Nov 2019 00:44:36 +0100 Subject: [PATCH] Don't display CPU usage until data is ready. --- server/TracyView.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 3fba89fd..f8c4ebb4 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -4416,7 +4416,11 @@ int View::DrawCpuData( int offset, double pxns, const ImVec2& wpos, bool hover, const auto cpuCnt = m_worker.GetCpuDataCpuCount(); assert( cpuCnt != 0 ); +#ifdef TRACY_NO_STATISTICS if( m_vd.drawCpuUsageGraph ) +#else + if( m_vd.drawCpuUsageGraph && m_worker.IsCpuUsageReady() ) +#endif { const auto cpuUsageHeight = floor( 30.f * ImGui::GetTextLineHeight() / 15.f ); if( wpos.y + offset + cpuUsageHeight + 3 >= yMin && wpos.y + offset <= yMax )