diff --git a/include/twin.h b/include/twin.h index 1c584d9..ea7e4a9 100644 --- a/include/twin.h +++ b/include/twin.h @@ -1005,16 +1005,12 @@ void twin_path_curve(twin_path_t *path, * timeout.c */ -#define twin_time_compare(a, op, b) (((a) - (b)) op 0) - twin_timeout_t *twin_set_timeout(twin_timeout_proc_t timeout_proc, twin_time_t delay, void *closure); void twin_clear_timeout(twin_timeout_t *timeout); -twin_time_t twin_now(void); - /* * toplevel.c */ diff --git a/src/timeout.c b/src/timeout.c index 0629f9e..04dfb9b 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -5,9 +5,20 @@ */ #include +#include +#include #include "twin_private.h" +#define twin_time_compare(a, op, b) (((a) - (b)) op 0) + +static twin_time_t twin_now(void) +{ + struct timeval tv; + gettimeofday(&tv, NULL); + return tv.tv_sec * 1000 + tv.tv_usec / 1000; +} + static twin_queue_t *head; static twin_time_t start; @@ -82,13 +93,3 @@ twin_time_t _twin_timeout_delay(void) } return -1; } - -#include -#include - -twin_time_t twin_now(void) -{ - struct timeval tv; - gettimeofday(&tv, NULL); - return tv.tv_sec * 1000 + tv.tv_usec / 1000; -}