.TH TICKIT_TIMER_AFTER_MSEC 3 .SH NAME tickit_timer_after_*, tickit_timer_cancel \- invoke a callback after a fixed delay .SH SYNOPSIS .EX .B #include .sp .BI "typedef int " TickitCallbackFn "(Tickit *" t ", TickitEventflags " flags , .BI " void *" user ); .sp .BI "int tickit_timer_after_msec(Tickit *" t ", int " msec , .BI " TickitBindFlags " flags ", TickitCallbackFn *" fn ", void *" user ); .BI "int tickit_timer_after_tv(Tickit *" t ", const struct timeval *" after , .BI " TickitBindFlags " flags ", TickitCallbackFn *" fn ", void *" user ); .sp .BI "void tickit_timer_cancel(Tickit *" t ", int " id ); .EE .sp Link with \fI\-ltickit\fP. .SH DESCRIPTION The \fBtickit_timer_after_*\fP() family of functions register a callback function to be invoked by the toplevel event loop a fixed delay afterwards. A registered callback will be invoked by a running call to \fBtickit_run\fP(3). The callback function will be invoked once, and then destroyed afterwards. Each function returns an opaque integer value which serves to identify this instance. .PP When invoked, the callback function is always passed both \fBTICKIT_EV_FIRE\fP and \fBTICKIT_EV_UNBIND\fP flags to its \fIflags\fP argument. If the callback had been registered with the \fBTICKIT_BIND_DESTROY\fP flag, then it will also be invoked with the \fBTICKIT_EV_DESTROY\fP flag if it has not yet been invoked by the time the toplevel instance is destroyed. .PP \fBtickit_timer_cancel\fP() removes a timer callback previously registered, by the identifier returned when it was added. If it had been added with the \fBTICKIT_BIND_UNBIND\fP flag then it will be invoked with the \fBTICKIT_EV_UNBIND\fP as it is removed. .SH "RETURN VALUE" \fBtickit_timer_after_msec\fP() and \fBtickit_timer_after_tv\fP() return an identifier integer. \fBtickit_timer_cancel\fP() returns no value. .SH "SEE ALSO" .BR tickit_new_stdio (3), .BR tickit_later (3), .BR tickit (7)