Improve stat tracking

This commit is contained in:
Nick Chambers 2021-06-30 22:27:18 -05:00
parent 88997e7a23
commit 6304235dc4
1 changed files with 10 additions and 11 deletions

View File

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