Skip to content

Instantly share code, notes, and snippets.

@ishida
Created May 29, 2012 07:08
Show Gist options
  • Save ishida/2823051 to your computer and use it in GitHub Desktop.
Save ishida/2823051 to your computer and use it in GitHub Desktop.
Measures time
#!/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