Instead of recording a timestamp once before iterating through all the
threads to check if we should add a new bw or iops log measurement,
record a new timestamp before checking each thread.
We were already querying the time anyway for the mtime_since_now() call.
We might as well have it available locally for more accurate logging.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
struct timespec now;
long elapsed_time = 0;
- fio_gettime(&now, NULL);
-
for_each_td(td) {
- elapsed_time = mtime_since_now(&td->epoch);
+ fio_gettime(&now, NULL);
+ elapsed_time = mtime_since(&td->epoch, &now);
if (!td->o.stats)
continue;