Mercurial > hg > Game > Cerium
changeset 1692:13ffed43fe68 draft
bug fix time.pl
author | Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 24 Sep 2013 00:00:16 +0900 |
parents | 6b3991ac3f07 |
children | 3cfc65841ef7 |
files | example/regex_mas/main.cc example/regex_mas/time.pl |
diffstat | 2 files changed, 15 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/example/regex_mas/main.cc Tue Sep 17 22:08:36 2013 +0900 +++ b/example/regex_mas/main.cc Tue Sep 24 00:00:16 2013 +0900 @@ -91,7 +91,6 @@ static st_mmap_t my_fread(TaskManager *manager,char *filename) { - /*マッピングだよ!*/ FILE *fd; st_mmap_t st_mmap;
--- a/example/regex_mas/time.pl Tue Sep 17 22:08:36 2013 +0900 +++ b/example/regex_mas/time.pl Tue Sep 24 00:00:16 2013 +0900 @@ -16,6 +16,8 @@ my $min_time = 0; my $max_time = 0; my $ave_time = 0; #average_time +my $error_cnt = 0; +my $looped_num = 0; if (@ARGV != 2) { print("Usage: ./time.pl [cpu_num] [regex_exec_num]\n"); @@ -32,19 +34,20 @@ while ($loop_counter < $loop_num){ $exec_result = `./regex -file c.txt -cpu $cpu_num`; #実行時のコマンドをここで入力 - - if($exec_result =~ /(\d+\.\d+)/ ){ - $time_result = $1 * 1000; #元の単位がsなので、ここでmsに変換 + if($exec_result =~ /Time/ || /HIT/){ + if($exec_result =~ /(\d+\.\d+)/ ){ + $time_result = $1 * 1000; #元の単位がsなので、ここでmsに変換 - if($min_time == 0) {$min_time = $time_result}; - if($time_result < $min_time) {$min_time = $time_result}; - if($time_result > $max_time) {$max_time = $time_result}; + if($min_time == 0) {$min_time = $time_result}; + if($time_result < $min_time) {$min_time = $time_result}; + if($time_result > $max_time) {$max_time = $time_result}; - $total_time += $time_result; + $total_time += $time_result; + print "Time:$time_result\n"; + ++$loop_counter; + } + ++$looped_num; } - - #print "time:$time_result\n"; - ++$loop_counter; } $ave_time = nearest(.001,$total_time / $loop_num); #小数点第4位未満四捨五入 (Math::Round) @@ -52,3 +55,5 @@ 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";