[PATCH] Improve time accounting for a job

We need to account loop time in usecs, or the null io engine can
get the timing wrong. For the system usage stats, don't use summed
up loop counts, but calculate end-start time instead.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/fio.h b/fio.h
index cb78f25..791b005 100644
--- a/fio.h
+++ b/fio.h
@@ -308,6 +308,7 @@
 
 	struct timeval start;	/* start of this loop */
 	struct timeval epoch;	/* time job was started */
+	struct timeval end_time;/* time job ended */
 
 	/*
 	 * fio system usage accounting
@@ -452,6 +453,7 @@
  * Time functions
  */
 extern unsigned long utime_since(struct timeval *, struct timeval *);
+extern unsigned long utime_since_now(struct timeval *);
 extern unsigned long mtime_since(struct timeval *, struct timeval *);
 extern unsigned long mtime_since_now(struct timeval *);
 extern unsigned long time_since_now(struct timeval *);