From e977fa915b278585aa63914bac03d79b955e8c1e Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 1 Dec 2006 10:52:20 +0100 Subject: [PATCH] [PATCH] BTT patch: Fix problem with short runs Found a problem that if BTT took less than 1 second to execute, we'd get Ktps of - this fixes that... Signed-off-by: Alan D. Brunelle Signed-off-by: Jens Axboe --- btt/bt_timeline.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/btt/bt_timeline.c b/btt/bt_timeline.c index fa56780..e6522c9 100644 --- a/btt/bt_timeline.c +++ b/btt/bt_timeline.c @@ -94,7 +94,8 @@ int process(void) latency_clean(); if (verbose) { - double tps = (double)n_traces / (double)(time(NULL) - genesis); + double tps = (double)n_traces / + (double)((time(NULL) + 1) - genesis); printf("%10lu traces @ %.1lf Ktps\n", n_traces, tps/1000.0); } -- 2.25.1