mirror of
https://github.com/AltraMayor/f3.git
synced 2025-08-03 10:35:57 -04:00
f3probe: avoid division by zero
Since some fake drives do not require resets, the option --time-ops was triggering a division by zero for those drives.
This commit is contained in:
parent
e7769bb77d
commit
08dd0e9061
@ -352,7 +352,8 @@ static void report_ops(const char *op, uint64_t count, uint64_t time_us)
|
||||
{
|
||||
printf("Probe %s op: count=%" PRIu64
|
||||
", total time=%.2fs, avg op time=%.2fms\n",
|
||||
op, count, time_us / 1e6, (time_us / count) / 1e3);
|
||||
op, count, time_us / 1e6,
|
||||
count > 0 ? (time_us / count) / 1e3 : 0.0);
|
||||
}
|
||||
|
||||
static int test_device(struct args *args)
|
||||
|
Loading…
x
Reference in New Issue
Block a user