changeset 1274:64e15fee0397 draft

add shell script that measure time
author Daichi Toma <toma@cr.ie.u-ryukyu.ac.jp>
date Sun, 20 Nov 2011 11:35:32 +0900
parents c1c8dbed726d
children 08d81be1c6e4
files example/Miller_Rabin/run.sh example/Miller_Rabin/time.sh
diffstat 2 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /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
--- /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 }}' 
+