From 5103eaa48b0ce91b9c655862d2b651a95acebb77 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Fri, 22 Jul 2005 20:27:27 +0000 Subject: [PATCH] Added a function which allows to read the timeval obtained during the last init_timer() / get_timer() call. --- lib/lib.h | 3 +++ lib/timer.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/lib/lib.h b/lib/lib.h index 00772320..9ecc55ac 100644 --- a/lib/lib.h +++ b/lib/lib.h @@ -173,8 +173,11 @@ uns nextprime(uns); /* timer.c */ +struct timeval; + void init_timer(void); uns get_timer(void); +void get_last_timeval(struct timeval *tv); /* regex.c */ diff --git a/lib/timer.c b/lib/timer.c index c8a0d474..86a2d198 100644 --- a/lib/timer.c +++ b/lib/timer.c @@ -44,3 +44,9 @@ init_timer(void) { gettimeofday(&last_tv, NULL); } + +void +get_last_timeval(struct timeval *tv) +{ + *tv = last_tv; +} -- 2.39.5