Skip to content

Commit

Permalink
Timer: Fix setting milliseconds
Browse files Browse the repository at this point in the history
Fix typo leading to wrong calculations.
  • Loading branch information
Zirias committed Aug 1, 2024
1 parent e739c82 commit 48cca8a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/core/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ SOEXPORT void PSC_Timer_setMs(PSC_Timer *self, unsigned ms)
struct itimerspec newtimeout = {
.it_interval = {
.tv_sec = ms / 1000U,
.tv_nsec = 1000000U * (ms & 1000U) },
.tv_nsec = 1000000U * (ms % 1000U) },
.it_value = {
.tv_sec = ms / 1000U,
.tv_nsec = 1000000U * (ms & 1000U) }
.tv_nsec = 1000000U * (ms % 1000U) }
};
if (!memcmp(&self->timeout, &newtimeout, sizeof self->timeout)) return;
self->timeout = newtimeout;
Expand Down

0 comments on commit 48cca8a

Please sign in to comment.