Fix time setup

This commit is contained in:
Bob Polis 2024-01-31 15:49:36 +01:00
parent 2aa529ebf1
commit 2e0a4dce54

View File

@ -12,8 +12,8 @@ void sc::timer::callback(union sigval sv) {
}
void sc::timer::setup_timer(double time, bool repeat) {
time_t secs = floor(time / 1000);
long ns = (time - 1000 * secs) * 1000000;
time_t secs = floor(time);
long ns = (time - secs) * 1000000;
struct itimerspec its;
its.it_value.tv_sec = secs;
its.it_value.tv_nsec = ns;