view _test/temp.pl @ 187:927653d01f4f

TTControl::AUTOLOAD now accesses nodeProperties Added TTControl::renderBlock property to access RENDER block of the template
author sergey
date Tue, 03 Apr 2012 07:54:25 +0400
parents 1f7a6d762394
children 4d0e1962161c
line wrap: on
line source

#!/usr/bin/perl
use strict;
use Time::HiRes qw(gettimeofday tv_interval);

sub func {
	1;
}

my $t0 = [gettimeofday()];

for(my $i = 0; $i < 1000000; $i++) {
	func(1);
}

print tv_interval($t0),"\n";

my $fn = sub { 1; };

$t0 = [gettimeofday()];

for(my $i = 0; $i < 1000000; $i++) {
	&$fn(1);
}

print tv_interval($t0),"\n";

sub dummy() { 0; }

$t0 = [gettimeofday()];

for(my $i = 0; $i < 1000000; $i++) {
	dummy;
}

print tv_interval($t0),"\n";

$t0 = [gettimeofday()];

for(my $i = 0; $i < 1000000; $i++) {
	1;
}

print tv_interval($t0),"\n";