changeset 1693:3cfc65841ef7 draft

fix time.pl
author Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
date Tue, 24 Sep 2013 00:16:21 +0900
parents 13ffed43fe68
children 1755ae347fce
files example/regex_mas/time.pl
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/example/regex_mas/time.pl	Tue Sep 24 00:00:16 2013 +0900
+++ b/example/regex_mas/time.pl	Tue Sep 24 00:16:21 2013 +0900
@@ -34,7 +34,7 @@
 while ($loop_counter < $loop_num){
 
     $exec_result = `./regex -file c.txt -cpu $cpu_num`; #実行時のコマンドをここで入力
-    if($exec_result =~ /Time/ || /HIT/){
+    if($exec_result =~ /Time:/){
         if($exec_result =~ /(\d+\.\d+)/ ){
             $time_result = $1 * 1000; #元の単位がsなので、ここでmsに変換
 
@@ -43,11 +43,11 @@
             if($time_result > $max_time) {$max_time = $time_result};
 
             $total_time += $time_result;
-            print "Time:$time_result\n";
+            #print "Time:$time_result\n";
             ++$loop_counter;
         }
-        ++$looped_num;
     }
+    ++$looped_num;
 }
 
 $ave_time = nearest(.001,$total_time / $loop_num); #小数点第4位未満四捨五入 (Math::Round)
@@ -55,5 +55,6 @@
 print "max:$max_time\n";
 print "min:$min_time\n";
 print "ave:$ave_time\n";
-print "loop num:$loop_counter\n";
-print "looped num:$looped_num\n";
+
+my $bug_num = $looped_num - $loop_counter;
+print "bug_num:$bug_num\n";