Currently moving from Gitlab to Gitea at https://labs.phundrak.com. Some features may not work anymore on this Gitlab instance.

better shell script

parent 5c596ea6
Pipeline #85 passed with stages
in 2 minutes and 29 seconds
#!/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)
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"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment