#!/bin/bash

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

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

    ../tri -g $max $size 1>../tabs/perf_tab.txt
    #cat tabs/perf_tab.txt
=======
    max=$(( `od -An -N4 -tu < /dev/urandom` % 100000))
    
    ../tri -g $max $size 1 >../tabs/perf_tab.txt
>>>>>>> 844a1820ad7242804acf3e13046b619e62101ce6
    for tri in "insertion" "fusion" "rapide" "bulle"
    do
        res=`( time -f "%U\t%M" ../tri --$tri ../tabs/perf_tab.txt > /dev/null ) 2>&1`
        echo -e "$iTest\t$size\t$tri\t$res"
    done
    rm ../tabs/perf_tab.txt
done