Skip to content

Instantly share code, notes, and snippets.

@adamatan
Created September 20, 2012 06:14
Show Gist options
  • Save adamatan/3754229 to your computer and use it in GitHub Desktop.
Save adamatan/3754229 to your computer and use it in GitHub Desktop.
Bash time difference
#!/bin/bash
# Based on http://www.cyberciti.biz/faq/shell-script-to-get-the-time-difference/
START=$(date +%s)
# Do something useful
END=$(date +%s)
DIFF=$(( $END - $START ))
echo "Finished in $DIFF seconds."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment