]> mj.ucw.cz Git - libucw.git/commitdiff
Added a function which allows to read the timeval obtained during
authorMartin Mares <mj@ucw.cz>
Fri, 22 Jul 2005 20:27:27 +0000 (20:27 +0000)
committerMartin Mares <mj@ucw.cz>
Fri, 22 Jul 2005 20:27:27 +0000 (20:27 +0000)
the last init_timer() / get_timer() call.

lib/lib.h
lib/timer.c

index 00772320648f2ae866f1dfa59d4daffcaac727e0..9ecc55ac8e1481bd922c5bb05616d4823e8bf876 100644 (file)
--- 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 */
 
index c8a0d4745d04a44c216905c0ca737b239a73e4ca..86a2d1984cd06ad5dec760ba572def3978ea8051 100644 (file)
@@ -44,3 +44,9 @@ init_timer(void)
 {
   gettimeofday(&last_tv, NULL);
 }
+
+void
+get_last_timeval(struct timeval *tv)
+{
+  *tv = last_tv;
+}