diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 7de69ef602..9cbe7ed37c 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1761,25 +1761,8 @@ void Application::checkFPS() { } void Application::idle() { - PROFILE_RANGE(__FUNCTION__); - static SimpleAverage interIdleDurations; - static uint64_t lastIdleEnd{ 0 }; - - if (lastIdleEnd != 0) { - uint64_t now = usecTimestampNow(); - interIdleDurations.update(now - lastIdleEnd); - static uint64_t lastReportTime = now; - if ((now - lastReportTime) >= (USECS_PER_SECOND)) { - static QString LOGLINE("Average inter-idle time: %1 us for %2 samples"); - if (Menu::getInstance()->isOptionChecked(MenuOption::LogExtraTimings)) { - qCDebug(interfaceapp_timing) << LOGLINE.arg((int)interIdleDurations.getAverage()).arg(interIdleDurations.getCount()); - } - interIdleDurations.reset(); - lastReportTime = now; - } - } - PerformanceTimer perfTimer("idle"); + if (_aboutToQuit) { return; // bail early, nothing to do here. } @@ -1823,15 +1806,13 @@ void Application::idle() { _idleLoopStdev.reset(); } + // After finishing all of the above work, restart the idle timer, allowing 2ms to process events. + idleTimer->start(2); } - // After finishing all of the above work, ensure the idle timer is set to the proper interval, - // depending on whether we're throttling or not - idleTimer->start(_glWidget->isThrottleRendering() ? THROTTLED_IDLE_TIMER_DELAY : 1); } // check for any requested background downloads. emit checkBackgroundDownloads(); - lastIdleEnd = usecTimestampNow(); } void Application::setFullscreen(bool fullscreen) {