surfaces-unies/run-time.sh

16 lines
408 B
Bash
Raw Normal View History

#!/bin/bash
2018-11-27 14:19:12 +00:00
if [ "$#" -ne 1 ]; then
echo "Bad usage of run-time.sh"
echo "./run-time <number of runs>"
exit 1
fi
echo "Starting $1 runs of surfaces-unies"
start=$(date +%s.%N)
2018-11-27 14:19:12 +00:00
for i in `seq 1 $1`; do
./bin/surfaces-unies -c -i ./img/asterix.ppm
./bin/surfaces-unies -u -i output.su
done
end=$(date +%s.%N)
2018-11-27 14:19:12 +00:00
runtime=$(python -c "print((${end} - ${start}) / ${1})")
echo "Average runtime was $runtime"