diff --git a/src/switch_time.c b/src/switch_time.c index c226b90592..009853b70b 100644 --- a/src/switch_time.c +++ b/src/switch_time.c @@ -413,10 +413,10 @@ static switch_status_t timerfd_start_interval(interval_timer_t *it, int interval return SWITCH_STATUS_GENERR; } - val.it_interval.tv_sec = 0; - val.it_interval.tv_nsec = interval * 1000000; + val.it_interval.tv_sec = interval / 1000; + val.it_interval.tv_nsec = (interval % 1000) * 1000000; val.it_value.tv_sec = 0; - val.it_value.tv_nsec = val.it_interval.tv_nsec; + val.it_value.tv_nsec = 100000; if (timerfd_settime(fd, TFD_TIMER_ABSTIME, &val, NULL) < 0) { close(fd);