mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-10-29 16:38:56 +00:00
Further simplify execute_and_measure
This commit is contained in:
1 parent
0ffc6d7cc0
commit
e1da8ba00f
2 files changed
+8
-10
No files matched your search
@@ -9,7 +9,7 @@ use crate::util::units::Second;
|
||||
|
||||
use super::timing_result::TimingResult;
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{bail, Context, Result};
|
||||
use statistical::mean;
|
||||
|
||||
pub trait Executor {
|
||||
@@ -79,10 +79,10 @@ impl<'a> Executor for ShellExecutor<'a> {
|
||||
.stdin(Stdio::null())
|
||||
.stdout(stdout)
|
||||
.stderr(stderr);
|
||||
let error_message = format!("Failed to run command '{}'", command.get_command_line());
|
||||
|
||||
let wallclock_timer = WallClockTimer::start();
|
||||
let result = execute_and_measure(command_builder, &error_message)?;
|
||||
let result = execute_and_measure(command_builder)
|
||||
.with_context(|| format!("Failed to run command '{}'", command.get_command_line()))?;
|
||||
let mut time_real = wallclock_timer.stop();
|
||||
|
||||
let mut time_user = result.user_time;
|
||||
|
||||
Reference in new issue
Block a user