- Change the hour/day eta display to be more clever.
- Style
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
static void eta_to_str(char *str, int eta_sec)
{
unsigned int d, h, m, s;
- static int always_d, always_h;
+ int disp_hour = 0;
d = h = m = s = 0;
eta_sec /= 24;
d = eta_sec;
- if (d || always_d) {
- always_d = 1;
+ if (d) {
+ disp_hour = 1;
str += sprintf(str, "%02ud:", d);
}
- if (h || always_h) {
- always_h = 1;
+
+ if (h || disp_hour)
str += sprintf(str, "%02uh:", h);
- }
str += sprintf(str, "%02um:", m);
str += sprintf(str, "%02us", s);
return NULL;
}
+ /*
+ * Set io data pointers.
+ */
io_u->xfer_buf = io_u->buf;
io_u->xfer_buflen = io_u->buflen;
+
fio_gettime(&io_u->start_time, NULL);
return io_u;
}
put_io_u(td, io_u);
}
}
-
-