Improve stat tracking

This commit is contained in:
Nick Chambers 2021-06-30 22:27:18 -05:00 committed by Nick Chambers
parent c1c29eeabf
commit 00748e5a52
1 changed files with 10 additions and 11 deletions

View File

@ -4,9 +4,17 @@
# stats # stats
### ###
export LAST_RELOAD
printf -v LAST_RELOAD '%(%s)T' -1
if [[ ! -v START_TIME ]]; then if [[ ! -v START_TIME ]]; then
export START_TIME export START_TIME=$LAST_RELOAD
printf -v START_TIME '%(%s)T' -1 fi
if [[ ! -v LONGEST_LIFE ]]; then
export LONGEST_LIFE=0
elif (( LONGEST_LIFE < SECONDS )); then
export LONGEST_LIFE=$SECONDS
fi fi
if [[ -v RELOADED ]]; then if [[ -v RELOADED ]]; then
@ -15,15 +23,6 @@ else
export RELOADED=0 export RELOADED=0
fi fi
export LAST_RELOAD
printf -v LAST_RELOAD '%(%s)T' -1
if [[ ! -v LONGEST_LIFE ]]; then
export LONGEST_LIFE=0
elif (( LONGEST_LIFE < SECONDS )); then
export LONGEST_LIFE=$SECONDS
fi
### ###
# switch toggler # switch toggler
### ###