Created
June 9, 2016 22:39
-
-
Save antenore/ee35a1f3b7b59830ee9c13c84e54c94d to your computer and use it in GitHub Desktop.
Shell script to measure elapsed time (bash, zsh, ksh)
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
#!/usr/bin/env bash | |
SECONDS=0 | |
START=$(date '+%Hh%M') | |
echo "This scripts measure How many seconds last the script" | |
echo "Press any key when you are ready" | |
read a | |
END=$(date '+%Hh%M') | |
if [ $SECONDS -ge 60 ] ; then | |
echo "$START, $END, $[$SECONDS / 60] min" | |
else | |
echo "$START, $END, $SECONDS sec" | |
fi | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment