#351: sleep longer in curses frontend

This reduces CPU usage, especially in idle.
This commit is contained in:
Andrey Prygunkov
2019-02-02 14:55:08 +01:00
parent 3a5bc85962
commit 82dfec471b

View File

@@ -213,8 +213,10 @@ void NCursesFrontend::Run()
m_dataUpdatePos = m_updateInterval;
}
Util::Sleep(10);
m_dataUpdatePos -= 10;
// update more often (sleep shorter) if need faster reaction on user input
int sleepInterval = m_inputMode == normal ? 100 : 10;
Util::Sleep(sleepInterval);
m_dataUpdatePos -= sleepInterval;
}
FreeData();