diff options
Diffstat (limited to 'mtime.sh')
-rwxr-xr-x | mtime.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/mtime.sh b/mtime.sh new file mode 100755 index 00000000..1cb5f8dc --- /dev/null +++ b/mtime.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +TMPFILE=`mktemp /tmp/mtime.XXXXXX` || exit 1 + +for x in {1..100} +do + gtime -f "real %e user %U sys %S" -a -o $TMPFILE "$@" + #tail -1 $TMPFILE +done + +awk '{ et += $2; ut += $4; st += $6; count++ } END { printf "%d iterations\n", count ; printf "average: real %.3f user %.3f sys %.3f\n", et/count, ut/count, st/count }' $TMPFILE + +rm $TMPFILE + |