Purpose:
Timing Script Execution, Generating Profiling Information
Example with automatic profiling start, stop, and output:
$profiler =& new Benchmark_Profiler(true); function myFunction() { $profiler->enterSection('myFunction'); //do something $profiler->leaveSection('myFunction'); return; } //do something myFunction(); //do more
Example without automatic profiling:
$profiler =& new Benchmark_Profiler(); function myFunction() { $profiler->enterSection('myFunction'); //do something $profiler->leaveSection('myFunction'); return; } $profiler->start(); //do something myFunction(); //do more $profiler->stop(); $profiler->display();