This commit is contained in:
chesteryue 2023-03-04 12:13:37 +08:00
parent 14030811e7
commit 786f129154

View file

@ -97,7 +97,7 @@ function command_status() {
# output command execute after # output command execute after
output_command_execute_after() { output_command_execute_after() {
if [ "$COMMAND_TIME_BEIGIN" = "-20200325" ] || [ "$COMMAND_TIME_BEIGIN" = "" ]; if [ "$COMMAND_TIME_BEGIN" = "-20200325" ] || [ "$COMMAND_TIME_BEGIN" = "" ];
then then
return 1; return 1;
fi fi
@ -121,8 +121,8 @@ output_command_execute_after() {
# cost # cost
local time_end="$(current_time_millis)"; local time_end="$(current_time_millis)";
local cost=$(bc -l <<<"${time_end}-${COMMAND_TIME_BEIGIN}"); local cost=$(bc -l <<<"${time_end}-${COMMAND_TIME_BEGIN}");
COMMAND_TIME_BEIGIN="-20200325" COMMAND_TIME_BEGIN="-20200325"
local length_cost=${#cost}; local length_cost=${#cost};
if [ "$length_cost" = "4" ]; if [ "$length_cost" = "4" ];
then then
@ -140,7 +140,7 @@ output_command_execute_after() {
# command execute before # command execute before
# REF: http://zsh.sourceforge.net/Doc/Release/Functions.html # REF: http://zsh.sourceforge.net/Doc/Release/Functions.html
preexec() { preexec() {
COMMAND_TIME_BEIGIN="$(current_time_millis)"; COMMAND_TIME_BEGIN="$(current_time_millis)";
} }
current_time_millis() { current_time_millis() {