2018-11-27 13:56:58 +00:00
|
|
|
#!/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"
|
2018-11-27 13:56:58 +00:00
|
|
|
start=$(date +%s.%N)
|
2018-11-27 14:19:12 +00:00
|
|
|
for i in `seq 1 $1`; do
|
2018-11-27 13:56:58 +00:00
|
|
|
./bin/surfaces-unies -c -i ./img/asterix.ppm
|
|
|
|
done
|
|
|
|
end=$(date +%s.%N)
|
2018-11-27 14:19:12 +00:00
|
|
|
runtime=$(python -c "print((${end} - ${start}) / ${1})")
|
2018-11-27 13:56:58 +00:00
|
|
|
echo "Average runtime was $runtime"
|