Created
May 29, 2012 07:08
-
-
Save ishida/2823051 to your computer and use it in GitHub Desktop.
Measures time
This file contains hidden or 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 | |
| START_TIME=`date +%s` | |
| # do something you want to measure time | |
| END_TIME=`date +%s` | |
| SS=`expr ${END_TIME} - ${START_TIME}` | |
| HH=`expr ${SS} / 3600` | |
| SS=`expr ${SS} % 3600` | |
| MM=`expr ${SS} / 60` | |
| SS=`expr ${SS} % 60` | |
| echo "Total Time: ${HH}:${MM}:${SS} (h:m:s)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment