#!/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) 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) runtime=$(python -c "print((${end} - ${start}) / ${1})") echo "Average runtime was $runtime"