view _test/temp.pl @ 407:c6e90e02dd17 ref20150831

renamed Lib->lib
author cin
date Fri, 04 Sep 2015 19:40:23 +0300
parents f23fcb19d3c1
children ee36115f6a34
line wrap: on
line source

#!/usr/bin/perl
use strict;

use Time::HiRes qw(gettimeofday tv_interval);
use constant COUNT => 20000000;

my $t;

$t = [gettimeofday];

for ( my $i = 0 ; $i < COUNT ; $i++ ) {
    my $o = [];
    $o->[0] = 10;
    $o->[20] = 11;
}

print "Arrays: ", tv_interval( $t, [gettimeofday] ), "\n";

$t = [gettimeofday];


for ( my $i = 0 ; $i < COUNT ; $i++ ) {
    my $o = {};	
    $o->{a} = 10;
    $o->{b} = 11;
}

print "Hashes: ", tv_interval( $t, [gettimeofday] ), "\n";



1;