4 ms·
Yeah, SECONDS is great. I just discovered this a few days ago to get a general idea of execution time for each process a script handles: # At top of script SE
by alexanderdmitri 9y ago
Yeah, SECONDS is great. I just discovered this a few days ago to get a general idea of execution time for each process a script handles:
# At top of script
SECONDS = 0
# script commands
...
# At bottom of script
duration=$SECONDS
echo "$(($duration / 60)) minutes and $(($duration % 60)) seconds elapsed."