Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # Section to timed between START an FINISH...
- START=$SECONDS
- echo "sleep 30s"
- sleep 30s
- FINISH=$SECONDS
- timer ()
- {
- hrs="$((($FINISH - $START)/3600))hrs"
- min="$(((($FINISH - $START)/60)%60))min"
- sec="$((($FINISH - $START)%60))sec"
- if [[ $(($FINISH - $START)) -gt 3600 ]]; then echo "$hrs, $min, $sec"
- elif [[ $(($FINISH - $START)) -gt 60 ]]; then echo "$min, $sec"
- else echo "$sec"
- fi
- }
- echo -n "Elapsed time: "; timer
Add Comment
Please, Sign In to add comment