From 7c6723d9129f86e020b5b8145848423b5de01665 Mon Sep 17 00:00:00 2001 From: John Keiser Date: Wed, 18 Mar 2020 12:24:56 -0700 Subject: [PATCH] Print progress bar even if there is only one file --- benchmark/parse.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/benchmark/parse.cpp b/benchmark/parse.cpp index 586f3427..bb997aa3 100644 --- a/benchmark/parse.cpp +++ b/benchmark/parse.cpp @@ -83,7 +83,7 @@ struct option_struct { bool stage1_only = false; int32_t iterations = 200; - int32_t iteration_step = 50; + int32_t iteration_step = -1; bool verbose = false; bool tabbed_output = false; @@ -149,6 +149,12 @@ struct option_struct { } } + if (iteration_step == -1) { + iteration_step = iterations / 50; + if (iteration_step < 200) { iteration_step = 200; } + if (iteration_step > iterations) { iteration_step = iterations; } + } + // All remaining arguments are considered to be files for (int i=optind; i