Created
March 30, 2017 16:12
-
-
Save superbrothers/5f0365701ecfeb58425e21893d56e861 to your computer and use it in GitHub Desktop.
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 | |
| set -e | |
| tempfile="$(mktemp)" | |
| trap "rm -rf $tempfile" EXIT | |
| dd if=/dev/zero of=$tempfile bs=1M count=1 | |
| start="$(date +%s%N)" | |
| for ((i=0; i<1000; i++)); do | |
| md5sum $tempfile >/dev/null 2>&1 | |
| done | |
| echo "md5sum: $(( $(date +%s%N) - $start))" | |
| start="$(date +%s%N)" | |
| for ((i=0; i<1000; i++)); do | |
| stat -c '%y' $tempfile >/dev/null 2>&1 | |
| done | |
| echo "stat: $(( $(date +%s%N) - $start))" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment