diff options
Diffstat (limited to 'src/benchmark.c')
-rw-r--r-- | src/benchmark.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/benchmark.c b/src/benchmark.c index d65b6ab0bb..5f41535c1a 100644 --- a/src/benchmark.c +++ b/src/benchmark.c @@ -122,7 +122,7 @@ void start_benchmark(struct benchmark_st * st) } /* returns the elapsed time */ -double stop_benchmark(struct benchmark_st * st, const char* metric) +double stop_benchmark(struct benchmark_st * st, const char* metric, int quiet) { double secs; unsigned long lsecs; @@ -149,14 +149,16 @@ double stop_benchmark(struct benchmark_st * st, const char* metric) if (metric == NULL) { /* assume bytes/sec */ value2human (st->size, secs, &ddata, &dspeed, imetric); - printf (" Processed %.2f %s in %.2f secs: ", ddata, imetric, secs); + if (quiet == 0) + printf (" Processed %.2f %s in %.2f secs: ", ddata, imetric, secs); printf ("%.2f %s/sec\n", dspeed, imetric); } else { ddata = (double) st->size; dspeed = ddata / secs; - printf (" Processed %.2f %s in %.2f secs: ", ddata, metric, secs); + if (quiet == 0) + printf (" Processed %.2f %s in %.2f secs: ", ddata, metric, secs); printf ("%.2f %s/sec\n", dspeed, metric); } |