Fix precision to use deciseconds instead of nanoseconds

pull/2119/head
BarbUk 2022-03-09 09:38:16 +01:00
parent a6fd93076d
commit 4686ce1f12
No known key found for this signature in database
GPG Key ID: DB301C759539E9FE
1 changed files with 2 additions and 0 deletions

View File

@ -22,9 +22,11 @@ function _command_duration() {
local -i minutes=0 seconds=0 deciseconds=0 local -i minutes=0 seconds=0 deciseconds=0
local -i command_start_seconds="${command_start%.*}" local -i command_start_seconds="${command_start%.*}"
local -i command_start_deciseconds=$((10#${command_start##*.})) local -i command_start_deciseconds=$((10#${command_start##*.}))
command_start_deciseconds="${command_start_deciseconds:0:1}"
local current_time="${EPOCHREALTIME:-$SECONDS}" local current_time="${EPOCHREALTIME:-$SECONDS}"
local -i current_time_seconds="${current_time%.*}" local -i current_time_seconds="${current_time%.*}"
local -i current_time_deciseconds="$((10#${current_time##*.}))" local -i current_time_deciseconds="$((10#${current_time##*.}))"
current_time_deciseconds="${current_time_deciseconds:0:1}"
if [[ "${command_start_seconds:-0}" -gt 0 ]]; then if [[ "${command_start_seconds:-0}" -gt 0 ]]; then
# seconds # seconds