API16:JProfiler/getInstance
From Joomla! Documentation
Description
Returns the global Profiler object, only creating it if it doesn't already exist.
Syntax
static getInstance($prefix= '')
| Parameter Name | Default Value | Description |
|---|---|---|
| $prefix | Prefix used to distinguish profiler objects. |
Returns
The Profiler object.
Defined in
libraries/joomla/error/profiler.php
Importing
jimport( 'joomla.error.profiler' );
Source Body
public static function getInstance($prefix = '')
{
static $instances;
if (!isset($instances)) {
$instances = array();
}
if (empty($instances[$prefix])) {
$instances[$prefix] = new JProfiler($prefix);
}
return $instances[$prefix];
}
Examples
Code Examples