bio
 
Loading...
Searching...
No Matches
timer.h
1#ifndef BIO_TIMER_H
2#define BIO_TIMER_H
3
4#include "bio.h"
5
15typedef struct {
16 bio_handle_t handle;
18
24
43 bio_time_t timeout_ms,
44 bio_entrypoint_t fn, void* userdata
45);
46
53bool
55
69void
71
78void
80
83#endif
void(* bio_entrypoint_t)(void *userdata)
Entrypoint for a coroutine.
Definition bio.h:120
int64_t bio_time_t
A timestamp.
Definition bio.h:213
bio_timer_t bio_create_timer(bio_timer_type_t type, bio_time_t timeout_ms, bio_entrypoint_t fn, void *userdata)
Create a new timer.
bool bio_is_timer_pending(bio_timer_t timer)
Check whether a timer is pending.
void bio_cancel_timer(bio_timer_t timer)
Cancel a timer.
bio_timer_type_t
Types of timer.
Definition timer.h:20
void bio_reset_timer(bio_timer_t timer, bio_time_t timeout_ms)
Reset a timer.
@ BIO_TIMER_ONESHOT
Trigger only once.
Definition timer.h:21
@ BIO_TIMER_INTERVAL
Trigger repeatedly.
Definition timer.h:22
Definition bio.h:126
Handle to a timer.
Definition timer.h:15