From: Steinar H. Gunderson Date: Sat, 19 Feb 2005 17:01:01 +0000 (+0000) Subject: Use await_notification instead of sleep(), gives us much better response time. X-Git-Url: https://git.sesse.net/?p=ccbs;a=commitdiff_plain;h=6e40dbdfce9194249658112b2837565b47b34b4d Use await_notification instead of sleep(), gives us much better response time. --- diff --git a/bigscreen/ccbs_bigscreen.cpp b/bigscreen/ccbs_bigscreen.cpp index 435d06a..dfb025f 100644 --- a/bigscreen/ccbs_bigscreen.cpp +++ b/bigscreen/ccbs_bigscreen.cpp @@ -45,7 +45,7 @@ void main_loop(pqxx::connection &conn) { if (active_tournament.id == -1) { // No active tournament, sleep a second or so and exit - sleep(1); + conn.await_notification(1, 0); return; } @@ -58,7 +58,7 @@ void main_loop(pqxx::connection &conn) memcpy(framebuf, screenbuf, 800*600*4); ptc_update(framebuf); - sleep(1); + conn.await_notification(0, 50000); } int main(int argc, char **argv)