diff --git a/run-time.sh b/run-time.sh index d23352c..5708fff 100755 --- a/run-time.sh +++ b/run-time.sh @@ -1,9 +1,14 @@ #!/bin/bash +if [ "$#" -ne 1 ]; then + echo "Bad usage of run-time.sh" + echo "./run-time " + exit 1 +fi +echo "Starting $1 runs of surfaces-unies" start=$(date +%s.%N) -nbloops=10 -for i in `seq 1 $nbloops`; do +for i in `seq 1 $1`; do ./bin/surfaces-unies -c -i ./img/asterix.ppm done end=$(date +%s.%N) -runtime=$(python -c "print((${end} - ${start}) / ${nbloops})") +runtime=$(python -c "print((${end} - ${start}) / ${1})") echo "Average runtime was $runtime"