From c88aa8f04f8059034359cf29ffc719c451ca6d3c Mon Sep 17 00:00:00 2001 From: Bob Polis Date: Wed, 31 Jan 2024 16:02:58 +0100 Subject: [PATCH] Fix nanoseconds for timer setup using seconds --- src/timer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/timer.cpp b/src/timer.cpp index b2fb1e9..7bd020d 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -13,7 +13,7 @@ void sc::timer::callback(union sigval sv) { void sc::timer::setup_timer(double time, bool repeat) { time_t secs = floor(time); - long ns = (time - secs) * 1000000; + long ns = (time - secs) * 1000000000; struct itimerspec its; its.it_value.tv_sec = secs; its.it_value.tv_nsec = ns;