}
}
- clock_gettime(CLOCK_REALTIME, &start_time);
+ clock_gettime(CLOCK_MONOTONIC, &start_time);
now = last_bw_print = start_time;
while (1) {
if (bandwidth_bytes_sec == 0)
continue;
- clock_gettime(CLOCK_REALTIME, &now);
+ clock_gettime(CLOCK_MONOTONIC, &now);
diff = timespec_sub(&start_time, &now);
write_target = ((bandwidth_bytes_sec * diff.tv_sec) +
((bandwidth_bytes_sec *
NSEC_PER_SEC / bandwidth_bytes_sec;
do {
- rc = clock_nanosleep(CLOCK_REALTIME, 0,
+ rc = clock_nanosleep(CLOCK_MONOTONIC, 0,
&delay, &delay);
} while (rc < 0 && errno == EINTR);
}
}
- clock_gettime(CLOCK_REALTIME, &now);
+ clock_gettime(CLOCK_MONOTONIC, &now);
if (stats_interval_sec && (write_bytes != file_size_bytes) &&
(now.tv_sec >= last_bw_print.tv_sec +
stats_interval_sec)) {
/* Output at least one log, regardless of stats_interval */
if (stats_interval_sec) {
- clock_gettime(CLOCK_REALTIME, &now);
+ clock_gettime(CLOCK_MONOTONIC, &now);
stats_log(&now, &start_time, read_bytes, write_bytes,
file_size_bytes);
}