summaryrefslogtreecommitdiffhomepage
path: root/proto-simconnect
diff options
context:
space:
mode:
authorTom Brazier <tom_github@firstsolo.net>2023-06-10 16:03:23 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-06-12 15:14:21 +0200
commit19f79a9f1b9cc9e86afad9aafbf4408276f61f15 (patch)
tree962097c250939d53ef85cf21e484cf8a3b22dc67 /proto-simconnect
parent2b68feee9be04a51facc56cbc0c1cb7616a26d6b (diff)
Use an efficient wait to check for 2s timeout and save a lotof CPU cycles
Diffstat (limited to 'proto-simconnect')
-rw-r--r--proto-simconnect/ftnoir_protocol_sc.cpp2
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)