2020-05-20 20:05:33 +03:00
|
|
|
function _tide_item_cmd_duration
|
2020-11-25 20:22:35 +03:00
|
|
|
if test $CMD_DURATION -gt $tide_cmd_duration_threshold
|
2021-09-27 21:46:58 +03:00
|
|
|
set -l time (math --scale=0 "$CMD_DURATION/3600000" # Hours
|
|
|
|
math --scale=0 "$CMD_DURATION/60000"%60 # Minutes
|
|
|
|
math --scale=$tide_cmd_duration_decimals "$CMD_DURATION/1000"%60) # Seconds
|
2020-05-13 22:46:42 +03:00
|
|
|
|
2021-09-27 21:46:58 +03:00
|
|
|
if test $time[1] != 0
|
2021-10-10 04:52:17 +03:00
|
|
|
_tide_print_item cmd_duration $tide_cmd_duration_icon' ' "$time[1]h $time[2]m $time[3]s"
|
2021-09-27 21:46:58 +03:00
|
|
|
else if test $time[2] != 0
|
2021-10-10 04:52:17 +03:00
|
|
|
_tide_print_item cmd_duration $tide_cmd_duration_icon' ' "$time[2]m $time[3]s"
|
2021-09-27 21:46:58 +03:00
|
|
|
else
|
2021-10-10 04:52:17 +03:00
|
|
|
_tide_print_item cmd_duration $tide_cmd_duration_icon' ' "$time[3]s"
|
2020-05-13 22:46:42 +03:00
|
|
|
end
|
|
|
|
end
|
2021-03-02 20:46:40 +03:00
|
|
|
end
|