view _test/temp.pl @ 408:5c80e33f1218 ref20150831

added 'coarsen' function
author cin
date Mon, 07 Sep 2015 01:35:25 +0300
parents c6e90e02dd17
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;