http://pastebin.com/fUjyXH9J
This is part of the package, the full package will be available soon!
Simple application using it:
Or with the new update instead ofPHP Code:<?php
$b = singleton::instance('\benchmark\tools');
for($i = 0; $i != 1000; $i++)
{
$b->start();
echo 'hello ';
$b->stop();
echo 'in ' . $b->end(5) . '<br/>'; # 5 decimal places.
$b->flush();
}
You could have:PHP Code:$b->stop();
echo 'in ' . $b->end(5) . '<br/>';
!! How cool! Function chaining!PHP Code:echo 'in ' . $b->stop()->end(5) . '<br/>';
Remember you don't have to flush! You can keep it in the functions variables. Just remember to use singleton! We don't want to be starting multiple timers now, do we?





Reply With Quote