diff options
author | kotfu <kotfu@kotfu.net> | 2018-05-06 13:38:40 -0600 |
---|---|---|
committer | kotfu <kotfu@kotfu.net> | 2018-05-06 13:38:40 -0600 |
commit | a1cbef5b4af0831ad57e4eaa75bdd77c15cb004b (patch) | |
tree | 28ba17ea3f257cbf74ac70d510dcfd1566a6e606 /mtime.sh | |
parent | fbbfe256cd23f87e5aad1dc4858c5e7c7753352b (diff) | |
download | cmd2-git-a1cbef5b4af0831ad57e4eaa75bdd77c15cb004b.tar.gz |
Add measurement script and document to track progress
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 + |