mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-21 19:51:50 +00:00
Introduce mg_timer_expired(). Adopt DHCP and link status to use it
This commit is contained in:
1 parent
a113e344a1
commit
f9272d0959
5 files changed
+54
-62
No files matched your search
+1
-1
@@ -828,7 +828,6 @@ void mg_log_set_fn(mg_pfn_t fn, void *param);
|
||||
struct mg_timer {
|
||||
unsigned long id; // Timer ID
|
||||
uint64_t period_ms; // Timer period in milliseconds
|
||||
uint64_t prev_ms; // Timestamp of a previous poll
|
||||
uint64_t expire; // Expiration timestamp in milliseconds
|
||||
unsigned flags; // Possible flags values below
|
||||
#define MG_TIMER_ONCE 0 // Call function once
|
||||
@@ -844,6 +843,7 @@ void mg_timer_init(struct mg_timer **head, struct mg_timer *timer,
|
||||
void *arg);
|
||||
void mg_timer_free(struct mg_timer **head, struct mg_timer *);
|
||||
void mg_timer_poll(struct mg_timer **head, uint64_t new_ms);
|
||||
bool mg_timer_expired(uint64_t *expiration, uint64_t period, uint64_t now);
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user