Skip to content

Instantly share code, notes, and snippets.

@wadewilliams
Last active February 8, 2023 20:11
Show Gist options
  • Save wadewilliams/cb5c90ea9a94797aeff0e884aa518549 to your computer and use it in GitHub Desktop.
Save wadewilliams/cb5c90ea9a94797aeff0e884aa518549 to your computer and use it in GitHub Desktop.
Report how long portions of a bash script take to run
function clock_time {
duration=$SECONDS
echo -e "$ARROW $(($duration / 60))m$(($duration % 60))s elapsed."
}
# Usage
SECONDS=0
thing_you_want_to_clock_goes_here
clock_time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment