Elapsed time on bash

Once a while is nice to measure elapse time on Linux on bash command line.
Here is an example how to count elapsed seconds:

$ time1=`date +"%Y-%m%d-%H:%M:%S";time1s=`date +"%s"`

$ time2s=`date +"%s"; echo Elapsed time since $time1 is `expr $time2s - $time1s` seconds

Elapsed time since 2019-1213-19:03:24 is 55 seconds
This entry was posted in workday. Bookmark the permalink.

Leave a Reply