Code snippets for symfony 1.x


Using timers to profile functions speed

This snippet allows you to evaluate functions speed and display them in symfony debug bar.

$timer = sfTimerManager::getTimer ('ldap_request'); // Create and start a new timer
// do some stuff
$timer->addTime (); // stop and store the timer value
by Arnaud Didry on 2009-06-22, tagged performance  profile  speed 

Comments on this snippet

gravatar icon
#1 Markus Welter on 2009-06-23 at 05:58

The correct method to store the timer value is addTime(), not addTimer().

So please use

gravatar icon
#2 Arnaud Didry on 2009-06-24 at 02:06

It's corrected, thanks for the typo !