diff options
Diffstat (limited to 'Utilities/cmlibuv/src/timer.c')
-rw-r--r-- | Utilities/cmlibuv/src/timer.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Utilities/cmlibuv/src/timer.c b/Utilities/cmlibuv/src/timer.c index 4cf4ed4264..1bea2a8bd2 100644 --- a/Utilities/cmlibuv/src/timer.c +++ b/Utilities/cmlibuv/src/timer.c @@ -130,6 +130,14 @@ uint64_t uv_timer_get_repeat(const uv_timer_t* handle) { } +uint64_t uv_timer_get_due_in(const uv_timer_t* handle) { + if (handle->loop->time >= handle->timeout) + return 0; + + return handle->timeout - handle->loop->time; +} + + int uv__next_timeout(const uv_loop_t* loop) { const struct heap_node* heap_node; const uv_timer_t* handle; |