mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-01 08:50:19 +00:00
Adopt the remaining statistics changes from #790
This commit is contained in:
1 parent
efd57b3a89
commit
8084a9eb7f
2 files changed
+35
-33
No files matched your search
@@ -54,13 +54,14 @@ impl Measurements {
|
||||
mean(self.wall_clock_times())
|
||||
}
|
||||
|
||||
/// The standard deviation of wall clock times, if at least two runs were measured.
|
||||
/// The standard deviation of all wall clock times. Not available if only one run has been performed
|
||||
pub fn stddev(&self) -> Option<Time> {
|
||||
if self.len() < 2 {
|
||||
let times: Vec<_> = self.wall_clock_times().collect(); // TODO: Avoid collecting
|
||||
|
||||
if times.len() < 2 {
|
||||
None
|
||||
} else {
|
||||
let times: Vec<_> = self.wall_clock_times().collect();
|
||||
Some(standard_deviation(×, self.time_wall_clock_mean()))
|
||||
Some(standard_deviation(times))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user