Mercurial > op > Looping
comparison Looping.pl @ 6:5e09f7cf87f5
Perl版のソースコードを追加。
author | "uncorrelated zombie" <uncorrelated@yahoo.co.jp> |
---|---|
date | Thu, 17 Feb 2011 15:32:22 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
5:861b93741d60 | 6:5e09f7cf87f5 |
---|---|
1 #!/usr/bin/perl -w | |
2 use Time::HiRes qw(gettimeofday); | |
3 use Looping; | |
4 | |
5 sub gettimeofday_sec { | |
6 my ($sec, $microsec) = gettimeofday; | |
7 return $sec + $microsec*1e-6; | |
8 } | |
9 | |
10 my $o = Looping->new; | |
11 my $n = 1; | |
12 | |
13 my $t1 = gettimeofday_sec(); | |
14 for(my $c=0;$c<2147483647;$c++){ | |
15 $n = $o->calc($n); | |
16 } | |
17 my $t2 = gettimeofday_sec(); | |
18 | |
19 printf("%d\nPerl\t%f", $n, $t2 - $t1); | |
20 | |
21 |