Created
June 1, 2020 10:40
-
-
Save blues911/34614f82bf9a334c96ddb58bf841d913 to your computer and use it in GitHub Desktop.
Bash script to calculate elapsed time.
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 | |
SECONDS=0 | |
echo 'Time Start:' $(date '+%Y-%m-%d %H:%M:%S') | |
# code... | |
echo 'Time End:' $(date '+%Y-%m-%d %H:%M:%S') | |
eval "echo Time Elapsed: $(date -ud "@$SECONDS" +'$((%s/3600/24)) days %H hours %M minutes %S seconds')" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment