Skip to content

Instantly share code, notes, and snippets.

@figaw
Created February 8, 2020 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save figaw/d306d6371dbc15a3cdcacbce489e1be1 to your computer and use it in GitHub Desktop.
Save figaw/d306d6371dbc15a3cdcacbce489e1be1 to your computer and use it in GitHub Desktop.
Time a shell command
#!/bin/bash
date +"%T"
SECONDS=0
sleep 5
date +"%T"
duration=$SECONDS
echo "$(($duration / 60)) minutes and $(($duration % 60)) seconds elapsed."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment