Skip to content

Instantly share code, notes, and snippets.

@delamonpansie
Created June 7, 2011 07:26
Show Gist options
  • Save delamonpansie/1011822 to your computer and use it in GitHub Desktop.
Save delamonpansie/1011822 to your computer and use it in GitHub Desktop.
ioping with time
--- ioping.c.orig 2011-06-07 11:23:20.533184637 +0400
+++ ioping.c 2011-06-07 12:02:50.652665892 +0400
@@ -457,11 +457,12 @@
if (this_time > part_max)
part_max = this_time;
- if (!quiet)
- printf("%lld bytes from %s (%s %s): request=%d time=%.1f ms\n",
- (long long)ret_size, path, fstype, device,
+ if (!quiet) {
+ printf("%i %lld bytes from %s (%s %s): request=%d time=%.1f ms\n",
+ (int)time(NULL), (long long)ret_size, path, fstype, device,
request, this_time / 1000.);
-
+ fflush(stdout);
+ }
if (period && request % period == 0) {
part_avg = part_sum / period;
part_mdev = sqrt(part_sum2 / period - part_avg * part_avg);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment