summaryrefslogtreecommitdiff
path: root/timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'timer.c')
-rw-r--r--timer.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/timer.c b/timer.c
new file mode 100644
index 0000000..8941ab7
--- /dev/null
+++ b/timer.c
@@ -0,0 +1,13 @@
+#include <sys/time.h>
+
+#include "timer.h"
+
+void set_itimer_interval_value(struct itimerval *itimer, unsigned long sec,
+ unsigned long usec)
+{
+ itimer->it_interval.tv_sec = sec;
+ itimer->it_interval.tv_usec = usec;
+
+ itimer->it_value.tv_sec = sec;
+ itimer->it_value.tv_usec = usec;
+}