From ec09cc7a71d6c2aa8b341568120af7fd68ab9f17 Mon Sep 17 00:00:00 2001 From: hhm Date: Thu, 3 Jul 2014 02:41:06 -0400 Subject: [PATCH] B"H view1090: sleep a bit between loops view1090 was using close to 100% CPU before, with the non-blocking commits and the reconnection code. sleep a bit between loop iterations to keep CPU usage low. CPU usage with this addition was down to <1% in testing. --- view1090.c | 1 + 1 file changed, 1 insertion(+) diff --git a/view1090.c b/view1090.c index 2dbd323..5ce15ad 100644 --- a/view1090.c +++ b/view1090.c @@ -291,6 +291,7 @@ int main(int argc, char **argv) { continue; } modesReadFromClient(c,"",decodeBinMessage); + usleep(100000); } // The user has stopped us, so close any socket we opened