From 6ac446878fe25f3f34f856c3daff4e4021b8b70c Mon Sep 17 00:00:00 2001 From: Christian Franke Date: Tue, 10 Nov 2015 18:04:41 +0100 Subject: lib: add function to get precise remaining time of timer thread Signed-off-by: Christian Franke Acked-by: Donald Sharp --- lib/thread.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/thread.c') diff --git a/lib/thread.c b/lib/thread.c index c56a9ec505..ab4764dfb1 100644 --- a/lib/thread.c +++ b/lib/thread.c @@ -766,6 +766,14 @@ strip_funcname (char *dest, const char *funcname) *e = tmp; } +struct timeval +thread_timer_remain(struct thread *thread) +{ + quagga_get_relative(NULL); + + return timeval_subtract(thread->u.sands, relative_time); +} + /* Get new thread. */ static struct thread * thread_get (struct thread_master *m, u_char type, -- cgit v1.2.3