# HG changeset patch # User Daichi Toma # Date 1321756532 -32400 # Node ID 64e15fee03979dbb12059cffc97593963d307aee # Parent c1c8dbed726d5fff19cdceb5a3e68ddc9f55ed68 add shell script that measure time diff -r c1c8dbed726d -r 64e15fee0397 example/Miller_Rabin/run.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/Miller_Rabin/run.sh Sun Nov 20 11:35:32 2011 +0900 @@ -0,0 +1,14 @@ +#!/bin/zsh + +a=1 +while [ $a -le 24 ] +do + b=0 + while [ $b -le 5 ] + do + echo -n "CPU_NUM $a " + time $* -cpu $a + b=`expr $b + 1` + done + a=`expr $a + 1` +done diff -r c1c8dbed726d -r 64e15fee0397 example/Miller_Rabin/time.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/Miller_Rabin/time.sh Sun Nov 20 11:35:32 2011 +0900 @@ -0,0 +1,4 @@ +#!/bin/zsh + +./run.sh $* |& awk '{cpu[$2]+=$12; total[$2]++;} END {for(i in cpu){ ans=cpu[i]/total[i]; print "CPU" i "\t" ans }}' +