mirror of
https://github.com/sharkdp/hyperfine.git
synced 2024-08-17 01:40:28 +03:00
Merge 866f2054b2
into e8ff88dad1
This commit is contained in:
commit
316baeb261
@ -265,7 +265,7 @@ impl<'a> Benchmark<'a> {
|
||||
|
||||
let msg = {
|
||||
let mean = format_duration(mean(×_real), self.options.time_unit);
|
||||
format!("Current estimate: {}", mean.to_string().green())
|
||||
format!("Current estimate: {}", mean.to_string().yellow().bold())
|
||||
};
|
||||
|
||||
if let Some(bar) = progress_bar.as_ref() {
|
||||
@ -321,31 +321,31 @@ impl<'a> Benchmark<'a> {
|
||||
if times_real.len() == 1 {
|
||||
println!(
|
||||
" Time ({} ≡): {:>8} {:>8} [User: {}, System: {}]",
|
||||
"abs".green().bold(),
|
||||
mean_str.green().bold(),
|
||||
"abs".yellow().bold(),
|
||||
mean_str.yellow().bold(),
|
||||
" ", // alignment
|
||||
user_str.blue(),
|
||||
system_str.blue()
|
||||
user_str.cyan(),
|
||||
system_str.cyan()
|
||||
);
|
||||
} else {
|
||||
let stddev_str = format_duration(t_stddev.unwrap(), Some(time_unit));
|
||||
|
||||
println!(
|
||||
" Time ({} ± {}): {:>8} ± {:>8} [User: {}, System: {}]",
|
||||
"mean".green().bold(),
|
||||
"σ".green(),
|
||||
mean_str.green().bold(),
|
||||
stddev_str.green(),
|
||||
user_str.blue(),
|
||||
system_str.blue()
|
||||
"mean".yellow().bold(),
|
||||
"σ",
|
||||
mean_str.yellow().bold(),
|
||||
stddev_str,
|
||||
user_str.cyan(),
|
||||
system_str.cyan()
|
||||
);
|
||||
|
||||
println!(
|
||||
" Range ({} … {}): {:>8} … {:>8} {}",
|
||||
"min".cyan(),
|
||||
"max".purple(),
|
||||
min_str.cyan(),
|
||||
max_str.purple(),
|
||||
"min".bright_green(),
|
||||
"max".bright_red(),
|
||||
min_str.bright_green(),
|
||||
max_str.bright_red(),
|
||||
num_str.dimmed()
|
||||
);
|
||||
}
|
||||
@ -393,7 +393,7 @@ impl<'a> Benchmark<'a> {
|
||||
eprintln!(" ");
|
||||
|
||||
for warning in &warnings {
|
||||
eprintln!(" {}: {}", "Warning".yellow(), warning);
|
||||
eprintln!(" {}: {}", "Warning".yellow().bold(), warning);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -84,13 +84,13 @@ impl<'a> Scheduler<'a> {
|
||||
for item in others {
|
||||
println!(
|
||||
"{}{} times faster than {}",
|
||||
format!("{:8.2}", item.relative_speed).bold().green(),
|
||||
format!("{:8.2}", item.relative_speed).yellow().bold(),
|
||||
if let Some(stddev) = item.relative_speed_stddev {
|
||||
format!(" ± {}", format!("{:.2}", stddev).green())
|
||||
format!(" ± {}", format!("{:.2}", stddev).yellow().bold())
|
||||
} else {
|
||||
"".into()
|
||||
},
|
||||
&item.result.command_with_unused_parameters.magenta()
|
||||
&item.result.command_with_unused_parameters.cyan()
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -100,11 +100,11 @@ impl<'a> Scheduler<'a> {
|
||||
for item in annotated_results {
|
||||
println!(
|
||||
" {}{} {}",
|
||||
format!("{:10.2}", item.relative_speed).bold().green(),
|
||||
format!("{:10.2}", item.relative_speed).yellow().bold(),
|
||||
if item.is_fastest {
|
||||
" ".into()
|
||||
} else if let Some(stddev) = item.relative_speed_stddev {
|
||||
format!(" ± {}", format!("{:5.2}", stddev).green())
|
||||
format!(" ± {}", format!("{:5.2}", stddev).yellow().bold())
|
||||
} else {
|
||||
" ".into()
|
||||
},
|
||||
@ -121,7 +121,7 @@ impl<'a> Scheduler<'a> {
|
||||
Try to re-run the benchmark on a quiet system. If you did not do so already, try the \
|
||||
--shell=none/-N option. If it does not help either, you command is most likely too fast \
|
||||
to be accurately benchmarked by hyperfine.",
|
||||
"Note".bold().red()
|
||||
"Note".bright_red()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ fn main() {
|
||||
match run() {
|
||||
Ok(_) => {}
|
||||
Err(e) => {
|
||||
eprintln!("{} {:#}", "Error:".red(), e);
|
||||
eprintln!("{} {:#}", "Error:".bright_red(), e);
|
||||
std::process::exit(1);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user