2016-03-01 17:40:38 +00:00
|
|
|
|
|
|
|
struct timer {
|
|
|
|
struct timer *next;
|
|
|
|
int linked; /* set is timer is initialized and linked */
|
2016-03-11 05:59:05 +00:00
|
|
|
double duration;
|
2016-03-01 17:40:38 +00:00
|
|
|
double timeout;
|
|
|
|
void (*fn)(struct timer *timer);
|
|
|
|
void *priv;
|
|
|
|
};
|
|
|
|
|
|
|
|
double get_time(void);
|
|
|
|
void timer_init(struct timer *timer, void (*fn)(struct timer *timer), void *priv);
|
|
|
|
void timer_exit(struct timer *timer);
|
|
|
|
void timer_start(struct timer *timer, double duration);
|
|
|
|
void timer_stop(struct timer *timer);
|
2016-04-16 14:43:42 +00:00
|
|
|
int timer_running(struct timer *timer);
|
2016-03-01 17:40:38 +00:00
|
|
|
void process_timer(void);
|
|
|
|
|