X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=time.c;h=ad5ee3fe51773c9019067f593834428afad8fc9b;hp=c7f898be3db3a853b0328c742478c8657e41eda1;hb=7313b48c3196b4750f4103e8622126039e2231c6;hpb=b990b5c06801d6d25e3fcc5415efbbe7bb23341e diff --git a/time.c b/time.c index c7f898be..ad5ee3fe 100644 --- a/time.c +++ b/time.c @@ -3,6 +3,8 @@ #include "fio.h" +static struct timeval genesis; + unsigned long utime_since(struct timeval *s, struct timeval *e) { double sec, usec; @@ -120,3 +122,13 @@ void rate_throttle(struct thread_data *td, unsigned long time_spent, td->rate_pending_usleep -= overtime; } } + +unsigned long mtime_since_genesis(void) +{ + return mtime_since_now(&genesis); +} + +void time_init(void) +{ + gettimeofday(&genesis, NULL); +}