#!/bin/sh
mypath="${0%/*}"
num_runs=3

set -e

do_runtest() {
  for i in $(jot ${num_runs}); do
    rm -rf /usr/obj/*
    sync
    echo "Doing build $1, run $i..."
    /usr/bin/time -l -o run-$1-$i.txt ${mypath}/build$1.sh > run-$1-$i.log
    head -1 run-$1-$i.txt
  done
}

do_runtest world_single
do_runtest world_multi

