# HG changeset patch # User Masataka Kohagura # Date 1376110333 -32400 # Node ID 3b8c12927f45cae93dbc4d0c76c933c46b0d25e4 # Parent eb3daec80cbb7d9a8b35a04f7f359e70a369fd1a insert Math::Round in regex_mas/time.pl diff -r eb3daec80cbb -r 3b8c12927f45 example/regex_mas/time.pl --- a/example/regex_mas/time.pl Thu Aug 08 12:35:26 2013 +0900 +++ b/example/regex_mas/time.pl Sat Aug 10 13:52:13 2013 +0900 @@ -7,6 +7,7 @@ use strict; use warnings; +use Math::Round; #有効数字以下四捨五入 my $loop_counter = 0; my $exec_result = 0; @@ -46,8 +47,8 @@ ++$loop_counter; } -$ave_time = $total_time / $loop_num; +$ave_time = nearest(.001,$total_time / $loop_num); #小数点第4位未満四捨五入 (Math::Round) print "max:$max_time\n"; print "min:$min_time\n"; -print "ave:$ave_time\n"; #有効数字3桁なので、平均も有効数字3桁にする??? +print "ave:$ave_time\n";