Mercurial > pub > Impl
comparison _test/temp.pl @ 167:1f7a6d762394
SQL schema in progress
author | sourcer |
---|---|
date | Thu, 12 May 2011 08:57:19 +0400 |
parents | 7245c39e941e |
children | 4d0e1962161c |
comparison
equal
deleted
inserted
replaced
166:4267a2ac3d46 | 167:1f7a6d762394 |
---|---|
1 #!/usr/bin/perl | 1 #!/usr/bin/perl |
2 use strict; | 2 use strict; |
3 use Time::HiRes qw(gettimeofday tv_interval); | |
3 | 4 |
4 use DateTime::TimeZone; | 5 sub func { |
6 1; | |
7 } | |
5 | 8 |
6 print "$_\n" foreach DateTime::TimeZone->names_in_category('America'); | 9 my $t0 = [gettimeofday()]; |
10 | |
11 for(my $i = 0; $i < 1000000; $i++) { | |
12 func(1); | |
13 } | |
14 | |
15 print tv_interval($t0),"\n"; | |
16 | |
17 my $fn = sub { 1; }; | |
18 | |
19 $t0 = [gettimeofday()]; | |
20 | |
21 for(my $i = 0; $i < 1000000; $i++) { | |
22 &$fn(1); | |
23 } | |
24 | |
25 print tv_interval($t0),"\n"; | |
26 | |
27 sub dummy() { 0; } | |
28 | |
29 $t0 = [gettimeofday()]; | |
30 | |
31 for(my $i = 0; $i < 1000000; $i++) { | |
32 dummy; | |
33 } | |
34 | |
35 print tv_interval($t0),"\n"; | |
36 | |
37 $t0 = [gettimeofday()]; | |
38 | |
39 for(my $i = 0; $i < 1000000; $i++) { | |
40 1; | |
41 } | |
42 | |
43 print tv_interval($t0),"\n"; | |
44 |