News for hackers. Stuff that matters.
Re:Interesting commands for the Linux shell by alexanderdmitri on Thursday September 14, 2017 @01:43PM (#15250472)
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."

There are no comments on this comment yet.