view conv1/benchmark.sh @ 16:23ad5811c88f

asm longjmp (can return correct address but return value is wrong)
author Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
date Sun, 24 Jan 2016 06:00:37 +0900
parents bacef8675607
children
line wrap: on
line source

#!/usr/bin/env zsh

time=/usr/bin/time
CONV1=./$1
num=10

count=0
amount=0
max=0
min=99999

echo "$CONV1 $2"
while [[ $count -lt $num ]]; do
    # /usr/bin/time -p ./conv1 1 2>&1 >& - |grep '^user'|tr -s " "|cut -f2 -d" "
    usertime=$( $time -p $CONV1 $2 2>&1 >& - |grep '^user'|tr -s " " |cut -f2 -d" ")
    echo $usertime

    amount=$(($usertime+$amount))
    if [[ $usertime -lt $min ]]; then
	min=$usertime
    fi
    if [[ $usertime -gt $max ]]; then
	max=$usertime
    fi
    count=$(($count+1))
done

echo "amount time = $amount"
echo "maxtime = $max"
echo "mintime = $min"


amount=$(($amount - $max - $min))
echo "amount time - mintime - maxtime = $amount"
count=$(($count-2))
echo "count = $count"
averagetime=$(($amount/($count)))
echo "average time = $averagetime"