#!/bin/bash

blah=""
runs=25


target=tempsized

#prog1=extract_features
prog1=gift-extract-features
#prog2=/disk1/gift/src/merge/gife2/FeatureExtraction/gift-extract-features
prog2=/disk1/gift/src/merge/dev/gift/FeatureExtraction/gift-extract-features


time $prog1 $target.ppm
mv $target.fts orig_$target.fts

for ((i=0;i<runs;i++)); do 
    {
	/usr/bin/time -o blah.out $prog2 $target.ppm
	blah="$blah`cat blah.out | sed -n \"/^[0-9.]*user/p\" | sed \"s/^0*\([0-9.]*\).*/\1+/\" | tr -d \"\n\"`"
	diff -a $target.fts orig_$target.fts
	echo $blah
    } 
done
echo -n $blah=" "
echo "scale=5; $blah" | sed "s/.$//" | bc	
bleh=`echo "scale=5; $blah" | sed "s/.$//" | bc`	
echo -n "magic number: "

echo "scale=5; $bleh / $runs " | bc

blah=""
bleh=""
runs=""
