16 lines
348 B
Bash
Executable file
16 lines
348 B
Bash
Executable file
#!/bin/bash
|
|
bench="$1"
|
|
against="$2"
|
|
|
|
cleanup() {
|
|
echo -e "\e[0;"
|
|
exit 0
|
|
}
|
|
trap cleanup INT
|
|
|
|
TIMEFORMAT='%3R'
|
|
for i in {1..8}; do
|
|
time "$bench" "$against"
|
|
done 2>&1 >/dev/null | awk 'BEGIN{m=999;printf " …\033[90m"}
|
|
{a+=$1;n++;m=$1<m?$1:m;printf " %6.3f",$1}
|
|
END{printf "\033[0m\nmin %6.3f — avg %6.3f — sum %7.3f\n",m,a/n,a}'
|