on-internet
← Community

How can I calculate time elapsed in a Bash script?

Stack Overflow ·

I print the start and end time using date +"%T", which results in something like: 10:33:56 10:36:10 How could I calculate and print the difference between these two? I would like to get something like: 2m 14s

Comments

Sign in or sign up to comment and upvote.

No comments yet.