From 6a565ea71745aaf4c91a7698bbf56f7d906fcaaa Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sun, 6 Dec 2020 11:52:26 +0200 Subject: Added build option for sleeping while idle It appears at least on macOS, SDL is doing a while lot of stuff while waiting for new events. Perhaps because it has some sort of high-frequency input/sensor processing? Not sure. Now Lagrange will idle by polling events every 15 ms and sleeping in between. This reduces CPU time by an order of magnitude on macOS. Need to still test on other platforms. --- src/app.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/app.h') diff --git a/src/app.h b/src/app.h index bc086dfe..743484a5 100644 --- a/src/app.h +++ b/src/app.h @@ -46,6 +46,7 @@ enum iAppEventMode { enum iUserEventCode { command_UserEventCode = 1, refresh_UserEventCode = 2, + asleep_UserEventCode = 3, }; const iString *execPath_App (void); -- cgit v1.2.3