mirror of
https://github.com/nushell/nushell.git
synced 2025-01-23 06:39:17 +01:00
change command duration env var to emit duration in milliseconds and also change var name to CMD_DURATION_MS (#3581)
This commit is contained in:
parent
a021b99614
commit
5ec226a416
@ -157,8 +157,8 @@ pub fn cli(context: EvaluationContext, options: Options) -> Result<(), Box<dyn E
|
||||
}
|
||||
// Store cmd duration in an env var
|
||||
context.scope.add_env_var(
|
||||
"CMD_DURATION",
|
||||
format!("{:?}", startup_commands_start_time.elapsed()),
|
||||
"CMD_DURATION_MS",
|
||||
format!("{}", startup_commands_start_time.elapsed().as_millis()),
|
||||
);
|
||||
trace!(
|
||||
"startup commands took {:?}",
|
||||
@ -332,9 +332,10 @@ pub fn cli(context: EvaluationContext, options: Options) -> Result<(), Box<dyn E
|
||||
};
|
||||
|
||||
// Store cmd duration in an env var
|
||||
context
|
||||
.scope
|
||||
.add_env_var("CMD_DURATION", format!("{:?}", cmd_start_time.elapsed()));
|
||||
context.scope.add_env_var(
|
||||
"CMD_DURATION_MS",
|
||||
format!("{}", cmd_start_time.elapsed().as_millis()),
|
||||
);
|
||||
|
||||
match line {
|
||||
LineResult::Success(line) => {
|
||||
|
Loading…
Reference in New Issue
Block a user