Actions

CodeExample

4dab2fe9de3d9

From Joomla! Documentation

Revision as of 13:22, 17 April 2011 by Chris Davenport (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Example

$p = JProfiler::getInstance('Application');
 
$p->mark('Start');
$a = str_repeat("hello world!\n", 100000);
$p->mark('Middle');
unset($a);
$p->mark('Stop');
 
print_r($p->getBuffer());

would output

Array
(
    [0] => Application Start: 0.000 seconds, 0.10 MB
    [1] => Application Middle: 0.005 seconds, 1.34 MB
    [2] => Application Stop: 0.005 seconds, 0.10 MB
)

This example was originally contributed by User:Artyom.


Chris Davenport 13:22, 17 April 2011 (CDT) Edit comment