Skip to content

Commit

Permalink
Don't print recommended sample count if it's the same as the actual s…
Browse files Browse the repository at this point in the history
…ample count. Fixes #322.
  • Loading branch information
bheisler committed Jan 18, 2020
1 parent ce17380 commit 41cc8fb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed `fibonacci` functions.
- Fixed `#[criterion]` benchmarks ignoring the command-line options.
- Fixed incorrect scaling of the violin plots.
- Don't print the recommended sample count if it's the same as the configured
sample count.

## [0.3.0] - 2019-08-25
### Added
Expand Down
10 changes: 8 additions & 2 deletions src/routine.rs
Expand Up @@ -112,8 +112,14 @@ pub trait Routine<M: Measurement, T> {
if d == 1 {
let recommended_sample_size = recommend_sample_size(m_ns as f64, met);
let actual_time = Duration::from_nanos(expected_ns as u64);
println!("\nWarning: Unable to complete {} samples in {:.1?}. You may wish to increase target time to {:.1?} or reduce sample count to {}",
n, config.measurement_time, actual_time, recommended_sample_size);
print!("\nWarning: Unable to complete {} samples in {:.1?}. You may wish to increase target time to {:.1?}",
n, config.measurement_time, actual_time);

if recommended_sample_size != n {
println!(" or reduce sample count to {}.", recommended_sample_size);
} else {
println!(".");
}
}

let m_iters = (1..(n + 1) as u64).map(|a| a * d).collect::<Vec<u64>>();
Expand Down

0 comments on commit 41cc8fb

Please sign in to comment.