Classe: Benchmark_Profiler - X-Ref
Provides timing and profiling information.
Example 1: Automatic profiling start, stop, and output.
<code>
<?php
require_once 'Benchmark/Profiler.php';
$profiler = new Benchmark_Profiler(TRUE);
function myFunction() {
global $profiler;
$profiler->enterSection('myFunction');
//do something
$profiler->leaveSection('myFunction');
return;
}
//do something
myFunction();
//do more
?>
</code>
Example 2: Manual profiling start, stop, and output.
<code>
<?php
require_once 'Benchmark/Profiler.php';
$profiler = new Benchmark_Profiler();
function myFunction() {
global $profiler;
$profiler->enterSection('myFunction');
//do something
$profiler->leaveSection('myFunction');
return;
}
$profiler->start();
//do something
myFunction();
//do more
$profiler->stop();
$profiler->display();
?>
</code>
_getOutput($format)
X-Ref
|
Returns formatted profiling information.
param: string output format (auto, plain or html), default auto
|
display($format = 'auto')
X-Ref
|
Returns formatted profiling information.
param: string output format (auto, plain or html), default auto
|