comparison _test/temp.pl @ 411:ee36115f6a34 ref20150831

sync
author cin
date Mon, 21 Sep 2015 00:53:10 +0300
parents c6e90e02dd17
children 30e8c6a74937
comparison
equal deleted inserted replaced
410:9335cf010b23 411:ee36115f6a34
1 #!/usr/bin/perl 1 #!/usr/bin/perl
2 use strict; 2 use strict;
3 3
4 use Time::HiRes qw(gettimeofday tv_interval); 4 use IMPL::require { ServicesBag => 'IMPL::Config::ServicesBag' };
5 use constant COUNT => 20000000;
6 5
7 my $t; 6 my $root = ServicesBag->new();
8
9 $t = [gettimeofday];
10
11 for ( my $i = 0 ; $i < COUNT ; $i++ ) {
12 my $o = [];
13 $o->[0] = 10;
14 $o->[20] = 11;
15 }
16
17 print "Arrays: ", tv_interval( $t, [gettimeofday] ), "\n";
18
19 $t = [gettimeofday];
20
21
22 for ( my $i = 0 ; $i < COUNT ; $i++ ) {
23 my $o = {};
24 $o->{a} = 10;
25 $o->{b} = 11;
26 }
27
28 print "Hashes: ", tv_interval( $t, [gettimeofday] ), "\n";
29
30 7
31 8
32 1; 9 1;