better shell script
This commit is contained in:
parent
5c596ea613
commit
1d014a20a7
11
run-time.sh
11
run-time.sh
@ -1,9 +1,14 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
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)
|
start=$(date +%s.%N)
|
||||||
nbloops=10
|
for i in `seq 1 $1`; do
|
||||||
for i in `seq 1 $nbloops`; do
|
|
||||||
./bin/surfaces-unies -c -i ./img/asterix.ppm
|
./bin/surfaces-unies -c -i ./img/asterix.ppm
|
||||||
done
|
done
|
||||||
end=$(date +%s.%N)
|
end=$(date +%s.%N)
|
||||||
runtime=$(python -c "print((${end} - ${start}) / ${nbloops})")
|
runtime=$(python -c "print((${end} - ${start}) / ${1})")
|
||||||
echo "Average runtime was $runtime"
|
echo "Average runtime was $runtime"
|
||||||
|
Loading…
Reference in New Issue
Block a user