Re: Timer
| From: | Sterling Hughes | Date: | Thu, 28 Sep 2000 14:42:23 +0000 |
| Subject: | Re: Timer | ||
| References: | 1 2 3 4 5 | Groups: | php.pear |
| Request: | Send a blank email to php-pear+get-287@lists.php.net to get a copy of this message | ||
> At 10:26 AM 9/28/00 -0400, you wrote:
> >Quoting Sebastian Bergmann <sb@phpopentracker.de>:
> >
> > > I don't know if anyone here's interested in this class, but
> > nevertheless I
> > > now added phpdoc-compliant inline-documentation and cleaned up the code a
> > > bit.
> >
> >This looks good. The only nit I'd like to pick is that I don't think it
> >belongs in the top level of the class hierarchy. I'd like to make a
> >Util/ directory, and move this to Util_Timer. Any objections or better
> >suggestions?
>
> I'd like to mirror CPAN as much as possible. Do you know where their Timer
> class is located?
>
The most similair Perl package is the Benchmark package:
use Benchmark;
sub logn {
my ($base, $number) = @_;
$res = log($number) / log($base);
return($res);
}
timethese(1000, { logn => 'logn(10, 34)' });
which would output:
Benchmark: timing 1000 iterations of logn:
logn: X secs (Y user Z sys = D cpu)
Where X, Y, Z and D are the appropriate times...
-Sterling