Created
February 8, 2020 16:27
-
-
Save figaw/d306d6371dbc15a3cdcacbce489e1be1 to your computer and use it in GitHub Desktop.
Time a shell command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
date +"%T" | |
SECONDS=0 | |
sleep 5 | |
date +"%T" | |
duration=$SECONDS | |
echo "$(($duration / 60)) minutes and $(($duration % 60)) seconds elapsed." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment