Skip to content
Browse files

Fix for tick intervals greater than one second.

  • Loading branch information...
1 parent 384f609 commit a9e17cc2fdadf34b6f2bdd1e8889259327d31578 @simonmar simonmar committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 rts/posix/Itimer.c
View
4 rts/posix/Itimer.c
@@ -155,7 +155,7 @@ startTicker(void)
struct itimerspec it;
it.it_value.tv_sec = TimeToSeconds(itimer_interval);
- it.it_value.tv_nsec = TimeToNS(itimer_interval);
+ it.it_value.tv_nsec = TimeToNS(itimer_interval) % 1000000000;
it.it_interval = it.it_value;
if (timer_settime(timer, 0, &it, NULL) != 0) {
@@ -168,7 +168,7 @@ startTicker(void)
struct itimerval it;
it.it_value.tv_sec = TimeToSeconds(itimer_interval);
- it.it_value.tv_usec = TimeToUS(itimer_interval);
+ it.it_value.tv_usec = TimeToUS(itimer_interval) % 1000000;
it.it_interval = it.it_value;
if (setitimer(ITIMER_REAL, &it, NULL) != 0) {

0 comments on commit a9e17cc

Please sign in to comment.
Something went wrong with that request. Please try again.