- duration_stop_measure(&duration, &duration_text);
-
- command_print(cmd_ctx, "dump image (address 0x%8.8x size %u) to file %s in %s (%f kB/s)",
- address, size, args[1], duration_text,
- (float)size / 1024.0 / ((float)duration.duration.tv_sec + ((float)duration.duration.tv_usec / 1000000.0)));
+ if (duration_measure(&bench) == ERROR_OK)
+ {
+ command_print(cmd_ctx, "dump image (address 0x%8.8" PRIx32 " "
+ "size %" PRIu32 ") to file %s in %fs (%0.3f kB/s)",
+ address, size, args[1],
+ duration_elapsed(&bench), duration_kbps(&bench, size));
+ }