Browse Source

use nanosleep() instead of usleep()

master
Andrew Tridgell 14 years ago
parent
commit
034755e432
  1. 5
      libraries/Desktop/support/main.cpp

5
libraries/Desktop/support/main.cpp

@ -13,8 +13,11 @@ int main(void)
gettimeofday(&sketch_start_time, NULL); gettimeofday(&sketch_start_time, NULL);
setup(); setup();
while (true) { while (true) {
struct timespec ts;
loop(); loop();
usleep(10); ts.tv_sec = 0;
ts.tv_nsec = 100;
nanosleep(&ts, NULL);
} }
return 0; return 0;
} }

Loading…
Cancel
Save