mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-12-03 21:31:03 +00:00
Unit safe statistics functions
This commit is contained in:
1 parent
f342e1f5de
commit
3a2c8ab177
3 files changed
+88
-40
No files matched your search
@@ -22,7 +22,7 @@ use crate::output::progress_bar::{
|
||||
};
|
||||
use crate::output::warnings::{OutlierWarningOptions, Warnings};
|
||||
use crate::parameter::ParameterNameAndValue;
|
||||
use crate::quantity::{self, const_time_from_seconds, Time, Quantity};
|
||||
use crate::quantity::{self, const_time_from_seconds, Quantity, Time};
|
||||
use benchmark_result::BenchmarkResult;
|
||||
|
||||
use anyhow::{anyhow, Result};
|
||||
@@ -421,8 +421,7 @@ impl<'a> Benchmark<'a> {
|
||||
if matches!(self.options.executor_kind, ExecutorKind::Shell(_))
|
||||
&& measurements
|
||||
.wall_clock_times()
|
||||
.iter()
|
||||
.any(|&t| t < MIN_EXECUTION_TIME)
|
||||
.any(|t| t < MIN_EXECUTION_TIME)
|
||||
{
|
||||
warnings.push(Warnings::FastExecutionTime);
|
||||
}
|
||||
@@ -448,7 +447,7 @@ impl<'a> Benchmark<'a> {
|
||||
|
||||
if scores[0] > OUTLIER_THRESHOLD {
|
||||
warnings.push(Warnings::SlowInitialRun(
|
||||
measurements.wall_clock_times()[0],
|
||||
measurements.wall_clock_times().next().unwrap(),
|
||||
outlier_warning_options,
|
||||
));
|
||||
} else if scores.iter().any(|&s| s.abs() > OUTLIER_THRESHOLD) {
|
||||
|
||||
Reference in new issue
Block a user