From 7d86cc5d2e0a188438626c9fcbb400850f848ba6 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Mon, 1 Dec 2025 21:47:40 -0500 Subject: alf: Fix elapsed time calculation (derp). --- src/alf.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/alf.c b/src/alf.c index dcf9e4e..82c9432 100644 --- a/src/alf.c +++ b/src/alf.c @@ -254,15 +254,19 @@ float tv_to_float(struct timeval *tv) { void print_elapsed_time(void) { struct timeval end_time; - float s, e; + float s, e, l, mbs; gettimeofday(&end_time, 0); end_time.tv_sec -= start_time.tv_sec; start_time.tv_sec = 0; + s = tv_to_float(&start_time); e = tv_to_float(&end_time); + l = e - s; + + mbs = ((float)total_in) / (1048576.0) / l; - printf("Elapsed time: %.3fs\n", e - s); + printf("Elapsed time: %.3fs (%.2fMB/s).\n", l, mbs); } int main(int argc, char **argv) { -- cgit v1.2.3