annotate _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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
210
6adaeb86945d added IMPL::Web::AutoLocator
sergey
parents: 209
diff changeset
1 #!/usr/bin/perl
6adaeb86945d added IMPL::Web::AutoLocator
sergey
parents: 209
diff changeset
2 use strict;
395
212cc86e470b Code cleanup
sergey
parents: 381
diff changeset
3
212cc86e470b Code cleanup
sergey
parents: 381
diff changeset
4 use Time::HiRes qw(gettimeofday tv_interval);
212cc86e470b Code cleanup
sergey
parents: 381
diff changeset
5
212cc86e470b Code cleanup
sergey
parents: 381
diff changeset
6 my $hash = {
212cc86e470b Code cleanup
sergey
parents: 381
diff changeset
7 x => 2.0,
212cc86e470b Code cleanup
sergey
parents: 381
diff changeset
8 y => 2.0,
212cc86e470b Code cleanup
sergey
parents: 381
diff changeset
9 z => 2.3,
212cc86e470b Code cleanup
sergey
parents: 381
diff changeset
10 w => 1.0
212cc86e470b Code cleanup
sergey
parents: 381
diff changeset
11 };
212cc86e470b Code cleanup
sergey
parents: 381
diff changeset
12
212cc86e470b Code cleanup
sergey
parents: 381
diff changeset
13 my $t = [gettimeofday];
210
6adaeb86945d added IMPL::Web::AutoLocator
sergey
parents: 209
diff changeset
14
395
212cc86e470b Code cleanup
sergey
parents: 381
diff changeset
15 for(my $i = 0; $i < 1000000; $i ++) {
212cc86e470b Code cleanup
sergey
parents: 381
diff changeset
16 $hash->{x} = $i;
212cc86e470b Code cleanup
sergey
parents: 381
diff changeset
17 }
212cc86e470b Code cleanup
sergey
parents: 381
diff changeset
18
212cc86e470b Code cleanup
sergey
parents: 381
diff changeset
19
212cc86e470b Code cleanup
sergey
parents: 381
diff changeset
20 print "HASH: ",tv_interval($t,[gettimeofday]),"\n";
212cc86e470b Code cleanup
sergey
parents: 381
diff changeset
21
212cc86e470b Code cleanup
sergey
parents: 381
diff changeset
22
212cc86e470b Code cleanup
sergey
parents: 381
diff changeset
23 my $array = [2,2,2.3,1.0];
212cc86e470b Code cleanup
sergey
parents: 381
diff changeset
24
212cc86e470b Code cleanup
sergey
parents: 381
diff changeset
25 $t = [gettimeofday];
212cc86e470b Code cleanup
sergey
parents: 381
diff changeset
26
212cc86e470b Code cleanup
sergey
parents: 381
diff changeset
27 for(my $i = 0; $i < 1000000; $i ++) {
212cc86e470b Code cleanup
sergey
parents: 381
diff changeset
28 $array->[1] = $i;
212cc86e470b Code cleanup
sergey
parents: 381
diff changeset
29 }
212cc86e470b Code cleanup
sergey
parents: 381
diff changeset
30
212cc86e470b Code cleanup
sergey
parents: 381
diff changeset
31 print "ARRAY: ",tv_interval($t,[gettimeofday]),"\n";