From 95420b83590a7a4c4f44b6e34270b4f4664228fa Mon Sep 17 00:00:00 2001 From: casey langen Date: Sat, 6 Mar 2021 14:36:26 -0800 Subject: [PATCH] Fix high CPU usage in musikcube-cmd build. --- src/musikcube/cursespp/cursespp/Window.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/musikcube/cursespp/cursespp/Window.h b/src/musikcube/cursespp/cursespp/Window.h index c8de306f2..739f627aa 100644 --- a/src/musikcube/cursespp/cursespp/Window.h +++ b/src/musikcube/cursespp/cursespp/Window.h @@ -40,11 +40,15 @@ #include #ifdef WIN32 -#define IDLE_TIMEOUT_MS 0 -#define REDRAW_DEBOUNCE_MS 100 + #if defined(PDCURSES_WINCON) || defined(_CONSOLE) + #define IDLE_TIMEOUT_MS 1 + #else + #define IDLE_TIMEOUT_MS 0 + #endif + #define REDRAW_DEBOUNCE_MS 100 #else -#define IDLE_TIMEOUT_MS 75 -#define REDRAW_DEBOUNCE_MS 100 + #define IDLE_TIMEOUT_MS 75 + #define REDRAW_DEBOUNCE_MS 100 #endif namespace cursespp {