From: Martin Mares Date: Fri, 22 Jul 2005 20:27:27 +0000 (+0000) Subject: Added a function which allows to read the timeval obtained during X-Git-Tag: holmes-import~757 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=5103eaa48b0ce91b9c655862d2b651a95acebb77;p=libucw.git Added a function which allows to read the timeval obtained during the last init_timer() / get_timer() call. --- 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; +}