view _test/temp.pl @ 395:212cc86e470b

Code cleanup DateTime locale support for HTTP requests
author sergey
date Thu, 20 Feb 2014 01:33:03 +0400
parents ced5937ff21a
children 38cb0b80e88e
line wrap: on
line source

#!/usr/bin/perl
use strict;

use Time::HiRes qw(gettimeofday tv_interval);

my $hash = {
	x => 2.0,
	y => 2.0,
	z => 2.3,
	w => 1.0
};

my $t = [gettimeofday];

for(my $i = 0; $i < 1000000; $i ++) {
	$hash->{x} = $i;
}


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


my $array = [2,2,2.3,1.0];

$t = [gettimeofday];

for(my $i = 0; $i < 1000000; $i ++) {
	$array->[1] = $i;
}

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