Improve logging accuracy
[fio.git] / time.c
diff --git a/time.c b/time.c
index b145e90e2da2fe2c4fa7e44100451f5c9434fabc..0e64af55ff96b0a9179367f60ca8f3a7ae90f798 100644 (file)
--- a/time.c
+++ b/time.c
@@ -6,6 +6,15 @@
 static struct timeval genesis;
 static unsigned long ns_granularity;
 
+void timeval_add_msec(struct timeval *tv, unsigned int msec)
+{
+       tv->tv_usec += 1000 * msec;
+       if (tv->tv_usec >= 1000000) {
+               tv->tv_usec -= 1000000;
+               tv->tv_sec++;
+       }
+}
+
 /*
  * busy looping version for the last few usec
  */