mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-02 01:00:31 +00:00
Add option to set time units for CLI & Markdown, closes #80
Add option to set the time units to either `MilliSecond` or `Second` for both CLI output and Markdown export, overriding the default logic.
This commit is contained in:
1 parent
1ec810f8d4
commit
f0b6f130ea
9 files changed
+172
-67
No files matched your search
@@ -254,7 +254,7 @@ pub fn run_benchmark(
|
||||
run_preparation_command(&options.shell, &prepare_cmd, options.show_output)?;
|
||||
|
||||
let msg = {
|
||||
let mean = format_duration(mean(×_real), None);
|
||||
let mean = format_duration(mean(×_real), options.time_unit);
|
||||
format!("Current estimate: {}", mean.to_string().green())
|
||||
};
|
||||
progress_bar.set_message(&msg);
|
||||
@@ -287,7 +287,7 @@ pub fn run_benchmark(
|
||||
let system_mean = mean(×_system);
|
||||
|
||||
// Formatting and console output
|
||||
let (mean_str, unit_mean) = format_duration_unit(t_mean, None);
|
||||
let (mean_str, unit_mean) = format_duration_unit(t_mean, options.time_unit);
|
||||
let stddev_str = format_duration(t_stddev, Some(unit_mean));
|
||||
let min_str = format_duration(t_min, Some(unit_mean));
|
||||
let max_str = format_duration(t_max, Some(unit_mean));
|
||||
|
||||
Reference in new issue
Block a user