}
}
+void
+timer_add_rel(struct main_timer *tm, timestamp_t expires_delta)
+{
+ struct main_context *m = main_current();
+ return timer_add(tm, m->now + expires_delta);
+}
+
void
timer_del(struct main_timer *tm)
{
static void dtimer(struct main_timer *tm)
{
msg(L_INFO, "Timer tick");
- timer_add(tm, main_get_now() + 10000);
+ timer_add_rel(tm, 10000);
}
static void dentry(void)
hook_add(&hook);
tm.handler = dtimer;
- timer_add(&tm, main_get_now() + 1000);
+ timer_add_rel(&tm, 1000);
mp.handler = dexit;
if (!process_fork(&mp))
* The @expire parameter is absolute, just add <<var_main_now,`main_now`>> if you need a relative timer.
**/
void timer_add(struct main_timer *tm, timestamp_t expires);
+
+void timer_add_rel(struct main_timer *tm, timestamp_t expires_delta);
+
/**
* Removes a timer from the active ones. It is permitted (and usual) to call
* this function from the timer's handler itself if you want to deactivate