From 2e0a4dce54f869e2f5c705a406aafbed23189b0a Mon Sep 17 00:00:00 2001 From: Bob Polis Date: Wed, 31 Jan 2024 15:49:36 +0100 Subject: [PATCH] Fix time setup --- src/timer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/timer.cpp b/src/timer.cpp index a0532a1..b2fb1e9 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -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;