aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/alf.c8
1 files 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) {