JProfiler

From Joomla! Documentation
(Difference between revisions)
Jump to: navigation, search
m (bad link repair)
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{incomplete}}
+
This class is available in the following Joomla versions:-
 
+
<splist showpath=notparent />
'''JProfiler''' is a class for performance analysis of your code. It allows to trace:
+
<noinclude>[[Category:Platform JClasses]][[Category:JProfiler]]</noinclude>
* execution time of a particular code part;
+
* memory amount used by your script at a specific program point.
+
 
+
===Defined in===
+
/joomla/error/profiler.php
+
 
+
===Importing===
+
<source lang="php">jimport( 'joomla.error.profiler' );</source>
+
 
+
===Example===
+
<source lang="php">
+
$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());
+
</source>
+
 
+
would output
+
 
+
<pre>
+
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
+
)
+
</pre>
+
 
+
===See also===
+
* [http://api.joomla.org/Joomla-Framework/Error/JProfiler.html JProfiler on api.joomla.org]
+
<noinclude>[[Category:Development]][[Category:Framework]][[Category:JProfiler]]</noinclude>
+

Latest revision as of 14:00, 29 August 2012

This class is available in the following Joomla versions:-

Page "JProfiler" has no subpages to list.
Personal tools
Namespaces

Variants
Actions
Navigation
Joomla! Sites
Toolbox