From 21cd986645e4e4f3bc2d1c30e6ec1ee3929e10c5 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Mon, 2 Oct 2017 20:57:20 -0700 Subject: [PATCH] tally PerformanceTimer records when it is active --- interface/src/ui/Stats.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/interface/src/ui/Stats.cpp b/interface/src/ui/Stats.cpp index 70cb74ed2f..fa5482f0d5 100644 --- a/interface/src/ui/Stats.cpp +++ b/interface/src/ui/Stats.cpp @@ -117,11 +117,6 @@ void Stats::updateStats(bool force) { } } - bool performanceTimerShouldBeActive = Menu::getInstance()->isOptionChecked(MenuOption::Stats) && _expanded; - if (performanceTimerShouldBeActive != PerformanceTimer::isActive()) { - PerformanceTimer::setActive(performanceTimerShouldBeActive); - } - auto nodeList = DependencyManager::get(); auto avatarManager = DependencyManager::get(); // we need to take one avatar out so we don't include ourselves @@ -404,7 +399,14 @@ void Stats::updateStats(bool force) { STAT_UPDATE(lodStatus, "You can see " + DependencyManager::get()->getLODFeedbackText()); } - bool performanceTimerIsActive = PerformanceTimer::isActive(); + + bool performanceTimerShouldBeActive = Menu::getInstance()->isOptionChecked(MenuOption::Stats) && _expanded; + if (performanceTimerShouldBeActive != PerformanceTimer::isActive()) { + PerformanceTimer::setActive(performanceTimerShouldBeActive); + } + if (performanceTimerShouldBeActive) { + PerformanceTimer::tallyAllTimerRecords(); // do this even if we're not displaying them, so they don't stack up + } if (performanceTimerShouldBeActive && Menu::getInstance()->isOptionChecked(MenuOption::DisplayDebugTimingDetails)) { @@ -412,7 +414,6 @@ void Stats::updateStats(bool force) { _showTimingDetails = true; emit timingExpandedChanged(); } - PerformanceTimer::tallyAllTimerRecords(); // do this even if we're not displaying them, so they don't stack up // we will also include room for 1 line per timing record and a header of 4 lines // Timing details... @@ -457,7 +458,7 @@ void Stats::updateStats(bool force) { emit timingExpandedChanged(); } - if (_expanded && performanceTimerIsActive) { + if (_expanded && performanceTimerShouldBeActive) { if (!_showGameUpdateStats) { _showGameUpdateStats = true; }