This reverts commit 0c88972f090abde0b2b91460aa4da37311445c9f.
Showing the changes to interface/src/Application.cpp (1 of 1 file). Show all
Unified · Split
| @@ -1761,25 +1761,8 @@ void Application::checkFPS() { · 1760 unmodified lines | |||
| 1761 | } | 1761 | } |
| 1762 | 1762 | ||
| 1763 | void Application::idle() { | 1763 | void Application::idle() { |
| 1764 | PROFILE_RANGE(__FUNCTION__); | ||
| 1765 | static SimpleAverage<float> interIdleDurations; | ||
| 1766 | static uint64_t lastIdleEnd{ 0 }; | ||
| 1767 | |||
| 1768 | if (lastIdleEnd != 0) { | ||
| 1769 | uint64_t now = usecTimestampNow(); | ||
| 1770 | interIdleDurations.update(now - lastIdleEnd); | ||
| 1771 | static uint64_t lastReportTime = now; | ||
| 1772 | if ((now - lastReportTime) >= (USECS_PER_SECOND)) { | ||
| 1773 | static QString LOGLINE("Average inter-idle time: %1 us for %2 samples"); | ||
| 1774 | if (Menu::getInstance()->isOptionChecked(MenuOption::LogExtraTimings)) { | ||
| 1775 | qCDebug(interfaceapp_timing) << LOGLINE.arg((int)interIdleDurations.getAverage()).arg(interIdleDurations.getCount()); | ||
| 1776 | } | ||
| 1777 | interIdleDurations.reset(); | ||
| 1778 | lastReportTime = now; | ||
| 1779 | } | ||
| 1780 | } | ||
| 1781 | |||
| 1782 | PerformanceTimer perfTimer("idle"); | 1764 | PerformanceTimer perfTimer("idle"); |
| 1765 | |||
| 1783 | if (_aboutToQuit) { | 1766 | if (_aboutToQuit) { |
| 1784 | return; // bail early, nothing to do here. | 1767 | return; // bail early, nothing to do here. |
| 1785 | } | 1768 | } |
| @@ -1823,15 +1806,13 @@ void Application::idle() { · 37 unmodified lines | |||
| 1823 | _idleLoopStdev.reset(); | 1806 | _idleLoopStdev.reset(); |
| 1824 | } | 1807 | } |
| 1825 | 1808 | ||
| 1809 | // After finishing all of the above work, restart the idle timer, allowing 2ms to process events. | ||
| 1810 | idleTimer->start(2); | ||
| 1826 | } | 1811 | } |
| 1827 | // After finishing all of the above work, ensure the idle timer is set to the proper interval, | ||
| 1828 | // depending on whether we're throttling or not | ||
| 1829 | idleTimer->start(_glWidget->isThrottleRendering() ? THROTTLED_IDLE_TIMER_DELAY : 1); | ||
| 1830 | } | 1812 | } |
| 1831 | 1813 | ||
| 1832 | // check for any requested background downloads. | 1814 | // check for any requested background downloads. |
| 1833 | emit checkBackgroundDownloads(); | 1815 | emit checkBackgroundDownloads(); |
| 1834 | lastIdleEnd = usecTimestampNow(); | ||
| 1835 | } | 1816 | } |
| 1836 | 1817 | ||
| 1837 | void Application::setFullscreen(bool fullscreen) { | 1818 | void Application::setFullscreen(bool fullscreen) { |