pub fn execute_and_measure(mut command: Command) -> Result<TimerResult> {
    let wallclock_timer = WallClockTimer::start();

    #[cfg(not(windows))]
    let ((time_user, time_system), status) = {
        let cpu_timer = self::unix_timer::CPUTimer::start();
        let status = command.status()?;
        (cpu_timer.stop(), status)
    };

    #[cfg(windows)]
    let ((time_user, time_system), status) = {
        let mut child = command.spawn()?;
        let cpu_timer = self::windows_timer::CPUTimer::start_for_process(&child);
        let status = child.wait()?;

        (cpu_timer.stop(), status)
    };

    let time_real = wallclock_timer.stop();

    Ok(TimerResult {
        time_real,
        time_user,
        time_system,
        status,
    })
}
/// Execute the given command and return a timing summary
Execute the given command and return a timing summary
Execute the given command and return a timing summary
pub fn execute_and_measure(mut command: Command) -> Result<TimerResult> {
    let wallclock_timer = WallClockTimer::start();
    #[cfg(not(windows))]
    let ((time_user, time_system), status) = {
        let cpu_timer = self::unix_timer::CPUTimer::start();
        let status = command.status()?;
        (cpu_timer.stop(), status)
    };
    #[cfg(windows)]
    let ((time_user, time_system), status) = {
        let mut child = command.spawn()?;
        let cpu_timer = self::windows_timer::CPUTimer::start_for_process(&child);
        let status = child.wait()?;
        (cpu_timer.stop(), status)
    };
    let time_real = wallclock_timer.stop();
    Ok(TimerResult {
        time_real,
        time_user,
        time_system,
        status,
    })
}
pub fn execute_and_measure ( mut command : Command ) -> Result < TimerResult > { let wallclock_timer = WallClockTimer :: start ( ) ; # [ cfg ( not ( windows ) ) ] let ( ( time_user , time_system ) , status ) = { let cpu_timer = self :: unix_timer :: CPUTimer :: start ( ) ; let status = command . status ( ) ? ; ( cpu_timer . stop ( ) , status ) } ; # [ cfg ( windows ) ] let ( ( time_user , time_system ) , status ) = { let mut child = command . spawn ( ) ? ; let cpu_timer = self :: windows_timer :: CPUTimer :: start_for_process ( & child ) ; let status = child . wait ( ) ? ; ( cpu_timer . stop ( ) , status ) } ; let time_real = wallclock_timer . stop ( ) ; Ok ( TimerResult { time_real , time_user , time_system , status , } ) }
Execute the given command and return a timing summary
Execute the given command and return a timing summary
command
Command