@@ -242,7 +242,7 @@ function eval_tester() (
242
242
printf ' %s' " $? " > " $semaphore_tty_status "
243
243
)
244
244
# capture
245
- local command_string time actual_exit_status actual_stdout actual_stderr actual_tty
245
+ local command_string time_before time_after time_ actual_exit_status actual_stdout actual_stderr actual_tty
246
246
args+=(
247
247
--trailing-newlines=" $option_trailing_newlines "
248
248
--redirect-status={actual_exit_status}
@@ -259,10 +259,11 @@ function eval_tester() (
259
259
fi
260
260
command_string=" $( echo-escape-command -- " ${option_cmd[@]} " ) "
261
261
echo-style --h2=" $title " --newline --element+bold=" $command_string "
262
- time =" $( __get_epoch_time) "
262
+ time_before =" $( __get_epoch_time) "
263
263
# __eval_helper --quiet="$option_quiet" --wrap <-- if this is done, element rendering, quite mode, and time duration can all be moved to eval-helper
264
264
__do " ${args[@]} " -- " ${option_cmd[@]} "
265
- time=" $( echo-math -- " $( __get_epoch_time) - $time " ) "
265
+ time_after=" $( __get_epoch_time) "
266
+ time_delta=" $( echo-math -- " $time_after - $time_before " ) "
266
267
if [[ $BASH_CLOSURE_OF_FILE_DESCRIPTOR_CLOSES_THE_STDIN_OF_ITS_PROCESS_SUBSTITUTION == ' no' ]]; then
267
268
__to --target=" $TERMINAL_OUTPUT_TARGET " -- $' \004 '
268
269
fi
@@ -300,10 +301,10 @@ function eval_tester() (
300
301
301
302
# pass or fail
302
303
if [[ $FAIL == ' yes' ]]; then
303
- echo-style --e2=" $title " ' ' --code=" in $time seconds" $' \n '
304
+ echo-style --e2=" $title " ' ' --code=" in $time_delta seconds" $' \n '
304
305
return 221 # ECUSTOM 221 Tests failed
305
306
else
306
- echo-style --g2=" $title " ' ' --code=" in $time seconds" $' \n '
307
+ echo-style --g2=" $title " ' ' --code=" in $time_delta seconds" $' \n '
307
308
fi
308
309
)
309
310
0 commit comments