diff options
author | Tom Brazier <tom_github@firstsolo.net> | 2023-06-10 16:03:23 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-06-12 15:14:21 +0200 |
commit | 19f79a9f1b9cc9e86afad9aafbf4408276f61f15 (patch) | |
tree | 962097c250939d53ef85cf21e484cf8a3b22dc67 | |
parent | 2b68feee9be04a51facc56cbc0c1cb7616a26d6b (diff) |
Use an efficient wait to check for 2s timeout and save a lotof CPU cycles
-rw-r--r-- | proto-simconnect/ftnoir_protocol_sc.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/proto-simconnect/ftnoir_protocol_sc.cpp b/proto-simconnect/ftnoir_protocol_sc.cpp index 226a427b..6fb6b949 100644 --- a/proto-simconnect/ftnoir_protocol_sc.cpp +++ b/proto-simconnect/ftnoir_protocol_sc.cpp @@ -53,7 +53,7 @@ void simconnect::run() { constexpr int max_idle_seconds = 2; - if (WaitForSingleObject(event, 0) == WAIT_OBJECT_0) + if (WaitForSingleObject(event, 1) == WAIT_OBJECT_0) tm.start(); if ((int)tm.elapsed_seconds() > max_idle_seconds) |