summaryrefslogtreecommitdiff
path: root/sysdep/unix/timer.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdep/unix/timer.h')
-rw-r--r--sysdep/unix/timer.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/sysdep/unix/timer.h b/sysdep/unix/timer.h
index 3ed6ff16..a20df483 100644
--- a/sysdep/unix/timer.h
+++ b/sysdep/unix/timer.h
@@ -30,6 +30,17 @@ void tm_start(timer *, unsigned after);
void tm_stop(timer *);
void tm_dump_all(void);
+static inline timer *
+tm_new_set(pool *p, void (*hook)(struct timer *), void *data, unsigned rand, unsigned rec)
+{
+ timer *t = tm_new(p);
+ t->hook = hook;
+ t->data = data;
+ t->randomize = rand;
+ t->recurrent = rec;
+ return t;
+}
+
extern bird_clock_t now; /* Relative, monotonic time in seconds */
extern bird_clock_t now_real; /* Time in seconds since fixed known epoch */