[Fwd: Avoiding redefining sub warnings in Benchmark.pm]
by Jarkko Hietaniemi other posts by this author
May 22 2007 5:46PM messages near this date
Re: [PATCH] Forgotten Cygwin patch
|
[perl #43023] Failure in perl 5.8.5 installation in linux7.2 - Please help
-------- Original Message --------
Subject: Avoiding redefining sub warnings in Benchmark.pm
Date: Tue, 22 May 2007 20:18:50 -0400
From: Steven Lembark <lembark@[...].com>
Reply-To: lembark@[...].com
Organization: Workhorse Computing
To: Jarkko Hietaniemi <jhi@[...].fi> , Tim Bunce <Tim.Bunce@[...].uk>
Given that Time::Hires uses a prototype (ouch), the
goto isn't enough overhead on the systems I've tested
this with to cause any real difference (i.e., after
100_000 iterations Benchmark didn't show any difference
testing a runt sub):
my $time = sub { time };
sub mytime () { goto &$time }
...
sub import
{
my $class = shift;
if (grep { $_ eq ":hireswallclock" } @_)
{
...
$time = $hirestime if defined $hirestime;
}
Benchmark-> export_to_level(1, $class, @_);
}
enjoi
--
Steven Lembark 85-09 90th Street
Workhorse Computing Woodhaven, NY 11421
lembark@[...].com +1 888 359 3508
|