Skip to content

Instantly share code, notes, and snippets.

@desyncr
Created August 31, 2016 03:44
Show Gist options
  • Save desyncr/35209c7f2e7d9a5250e040bca6977b2d to your computer and use it in GitHub Desktop.
Save desyncr/35209c7f2e7d9a5250e040bca6977b2d to your computer and use it in GitHub Desktop.
#!/bin/bash
rm -f /tmp/mtime.$$
for x in {1..10}
do
/usr/bin/time -f "real %e user %U sys %S" -a -o /tmp/mtime.$$ $@
tail -1 /tmp/mtime.$$
done
awk '{ et += $2; ut += $4; st += $6; count++ } END { printf "Average:\nreal %.3f user %.3f sys %.3f\n", et/count, ut/count, st/count }' /tmp/mtime.$$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment