# HG changeset patch # User Nobuyasu Oshiro # Date 1325610901 -32400 # Node ID 689bf9141c8c6190bca648546a6bf05e6d0497fb # Parent 0a063106bba9b0580e334a3741ad5a1c7f9e7cdc add conv1/benchmark.sh diff -r 0a063106bba9 -r 689bf9141c8c CbC-examples/conv1/benchmark.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CbC-examples/conv1/benchmark.sh Wed Jan 04 02:15:01 2012 +0900 @@ -0,0 +1,37 @@ +#!/usr/bin/env zsh + +time=/usr/bin/time +CONV1=./conv1 +num=10 + +count=0 +amount=0 + +echo "$CONV1 $1" +while [[ $count -lt $num ]]; do + # /usr/bin/time -p ./conv1 1 2>&1 >& - |grep '^user'|tr -s " "|cut -f2 -d" " + usertime=$( $time -p $CONV1 1 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" + diff -r 0a063106bba9 -r 689bf9141c8c CbC-examples/quicksort/benchmark.sh --- a/CbC-examples/quicksort/benchmark.sh Sun Dec 25 04:17:22 2011 +0900 +++ b/CbC-examples/quicksort/benchmark.sh Wed Jan 04 02:15:01 2012 +0900 @@ -14,6 +14,7 @@ echo "size of array = $size" while [[ $count -lt $num ]]; do + echo "$time -p $QS -n $size -s $seed 2>&1 >& - |grep '^user'|tr -s \" \"|cut -f2 -d\" \" " usertime=$( $time -p $QS -n $size -s $seed 2>&1 >& - |grep '^user'|tr -s " "|cut -f2 -d" ") #usertime=$(printf "%d" $usertime) echo $usertime