Added options to specify the max/exact numbers of runs.

Fixes #77.
This commit is contained in:
Diogo Sousa authored and David Peter committed 2018-09-09 23:18:18 +02:00
1 parent fe041df718
commit d78c33b864
5 files changed
+110 -28

No files matched your search

+21 -3
View File
@@ -73,13 +73,31 @@ pub enum OutputStyleOption {
NoColor,
}
/// Number of runs for a benchmark
pub struct Runs {
/// Minimum number of benchmark runs
pub min: u64,
/// Maximum number of benchmark runs
pub max: u64,
}
impl Default for Runs {
fn default() -> Runs {
Runs {
min: 10,
max: ::std::u64::MAX,
}
}
}
/// A set of options for hyperfine
pub struct HyperfineOptions {
/// Number of warmup runs
pub warmup_count: u64,
/// Minimum number of benchmark runs
pub min_runs: u64,
/// Number of benchmark runs
pub runs: Runs,
/// Minimum benchmarking time
pub min_time_sec: Second,
@@ -101,7 +119,7 @@ impl Default for HyperfineOptions {
fn default() -> HyperfineOptions {
HyperfineOptions {
warmup_count: 0,
min_runs: 10,
runs: Runs::default(),
min_time_sec: 3.0,
failure_action: CmdFailureAction::RaiseError,
preparation_command: None,