diff --git a/src/main.rs b/src/main.rs index df62955..3716bb6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,6 +4,7 @@ extern crate rust_util; use std::{env, fs, process}; use std::path::PathBuf; use std::process::Command; +use std::time::SystemTime; use rust_util::{util_cmd, util_msg}; use rust_util::util_msg::MessageType; @@ -47,10 +48,14 @@ fn main() { run_script_cmd.arg(arg); } debugging!("Run command: {:?}", run_script_cmd); + let run_command_start = SystemTime::now(); match util_cmd::run_command_and_wait(&mut run_script_cmd) { Err(e) => failure_and_exit!("Run rust-script failed: {}", e), Ok(exit_status) => { write_script_file_to_src(script_file, cache_script_bin_name); + if let Ok(run_command_cost) = SystemTime::now().duration_since(run_command_start) { + debugging!("Run command cost: {}ms", run_command_cost.as_millis()); + } process::exit(exit_status.code().unwrap_or_else(|| 0)) } }