#!/bin/bash

echo "iTest\ttaille\ttri\ttemps\tmem"

for iTest in `seq 1 3`
do
    size=$(( `od -An -N4 -tu < /dev/urandom` % 100000))
    max=$(( `od -An -N4 -tu < /dev/urandom` % 100000))

    ../tri -g $max $size 1 >../tabs/perf_tab.txt
    for tri in "insertion" "fusion" "rapide" "bulle"
    do
        res=`( /usr/bin/time -f "%U\t%M" ../tri --$tri ../tabs/perf_tab.txt > /dev/null ) 2>&1`
        echo "$iTest\t$size\t$tri\t$res"
    done
    rm ../tabs/perf_tab.txt
done