Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add median to the end of output #344

Closed
wants to merge 4 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/hyperfine/benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ pub fn run_benchmark(
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 median_str = format_duration(t_median, Some(unit_mean));
let max_str = format_duration(t_max, Some(unit_mean));
let num_str = format!("{} runs", t_num);

Expand All @@ -380,10 +381,11 @@ pub fn run_benchmark(
);

println!(
" Range ({} … {}): {:>8} … {:>8} {}",
" Range ({} … {}): {:>8} … {:>8} (median: {}) {:>10}",
"min".cyan(),
"max".purple(),
min_str.cyan(),
median_str.blue(),
nicholas-l marked this conversation as resolved.
Show resolved Hide resolved
max_str.purple(),
num_str.dimmed()
);
Expand Down