make the warmup and execute phases clearer
authorAndrew Tridgell <tridge@samba.org>
Wed, 10 Mar 2004 05:05:56 +0000 (05:05 +0000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 10 Mar 2004 05:05:56 +0000 (05:05 +0000)
(This used to be commit d49e4407e59a25c8e887b552ed2a58de7a16b6d9)

source4/torture/nbench/nbio.c

index fee3af05e4a0b0201115c60bec1017e9928b3618..8a9c36f1d0df3cd0884ae40070b4dbff86e6233b 100644 (file)
@@ -73,16 +73,25 @@ void nb_alarm(void)
 
        t = end_timer();
 
-       printf("%4d  %8d  %.2f MB/sec  time %.0f sec   \r", 
-              num_clients, lines/nprocs, 
-              1.0e-6 * nbio_total() / t, 
-              t - warmup);
+       if (warmup) {
+               printf("%4d  %8d  %.2f MB/sec  warmup %.0f sec   \r", 
+                      num_clients, lines/nprocs, 
+                      1.0e-6 * nbio_total() / t, 
+                      t);
+       } else {
+               printf("%4d  %8d  %.2f MB/sec  execute %.0f sec   \r", 
+                      num_clients, lines/nprocs, 
+                      1.0e-6 * nbio_total() / t, 
+                      t);
+       }
 
        if (warmup && t >= warmup) {
                start_timer();
                warmup = 0;
        }
 
+       fflush(stdout);
+
        signal(SIGALRM, nb_alarm);
        alarm(1);       
 }