From 034755e43293c4f1f846e99a64782a6024f3c6b6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 9 Oct 2011 21:22:10 +1100 Subject: [PATCH] use nanosleep() instead of usleep() --- libraries/Desktop/support/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/Desktop/support/main.cpp b/libraries/Desktop/support/main.cpp index f8efc34ac7..b45a3e1230 100644 --- a/libraries/Desktop/support/main.cpp +++ b/libraries/Desktop/support/main.cpp @@ -13,8 +13,11 @@ int main(void) gettimeofday(&sketch_start_time, NULL); setup(); while (true) { + struct timespec ts; loop(); - usleep(10); + ts.tv_sec = 0; + ts.tv_nsec = 100; + nanosleep(&ts, NULL); } return 0; }