Reset elapsed every time the progress bar is increased.

This commit is contained in:
Jooris Hadeler 2023-11-20 19:39:31 +01:00
parent 4e8cb3fec0
commit c83b4126ea
2 changed files with 8 additions and 4 deletions

View File

@ -215,7 +215,8 @@ impl<'a> Executor for ShellExecutor<'a> {
}
if let Some(bar) = progress_bar.as_ref() {
bar.inc(1)
bar.inc(1);
bar.reset_elapsed();
}
}

View File

@ -165,7 +165,8 @@ impl<'a> Benchmark<'a> {
let _ = run_preparation_command()?;
let _ = self.executor.run_command_and_measure(self.command, None)?;
if let Some(bar) = progress_bar.as_ref() {
bar.inc(1)
bar.inc(1);
bar.reset_elapsed();
}
}
if let Some(bar) = progress_bar.as_ref() {
@ -224,7 +225,8 @@ impl<'a> Benchmark<'a> {
bar.set_length(count)
}
if let Some(bar) = progress_bar.as_ref() {
bar.inc(1)
bar.inc(1);
bar.reset_elapsed();
}
// Gather statistics (perform the actual benchmark)
@ -251,7 +253,8 @@ impl<'a> Benchmark<'a> {
all_succeeded = all_succeeded && success;
if let Some(bar) = progress_bar.as_ref() {
bar.inc(1)
bar.inc(1);
bar.reset_elapsed();
}
}