mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-01 08:50:19 +00:00
Further simplification of the API
This commit is contained in:
1 parent
4badeb6312
commit
ebf127338c
4 files changed
+51
-95
No files matched your search
@@ -53,10 +53,9 @@ pub trait MarkupExporter {
|
||||
let cmd_str = result.command_with_unused_parameters().replace('|', "\\|");
|
||||
let mean_str = result
|
||||
.mean_wall_clock_time()
|
||||
.format_value_auto(Some(time_unit))
|
||||
.0;
|
||||
.format_value_auto(Some(time_unit));
|
||||
let stddev_str = if let Some(stddev) = result.measurements.stddev() {
|
||||
format!(" ± {}", stddev.format_value_auto(Some(time_unit)).0)
|
||||
format!(" ± {}", stddev.format_value_auto(Some(time_unit)))
|
||||
} else {
|
||||
"".into()
|
||||
};
|
||||
@@ -117,10 +116,7 @@ pub trait MarkupExporter {
|
||||
fn determine_unit_from_results(results: &[BenchmarkResult]) -> TimeUnit {
|
||||
if let Some(first_result) = results.first() {
|
||||
// Use the first BenchmarkResult entry to determine the unit for all entries.
|
||||
first_result
|
||||
.mean_wall_clock_time()
|
||||
.format_auto_with_unit(None)
|
||||
.1
|
||||
first_result.mean_wall_clock_time().suitable_unit()
|
||||
} else {
|
||||
// Default to `Second`.
|
||||
TimeUnit::Second
|
||||
|
||||
Reference in new issue
Block a user