Profiler
Utility class to assist in the process of benchmarking the execution of sections of code to understand where time is being spent.
since |
1.7.0 |
---|---|
package |
Joomla CMS |
Methods
__construct
Constructor
__construct(string prefix = '') : mixed
since |
1.7.0 |
---|
Arguments
- prefix
string
Prefix for mark messages
Response
mixed
getBuffer
Get all profiler mark buffers.
getBuffer() : array
Returns an array of all mark buffers created since the Profiler object was instantiated. Marks are strings as per {@link Profiler::mark()}.
since |
1.7.0 |
---|
Response
array
Array of profiler marks
getInstance
Returns the global Profiler object, only creating it if it doesn't already exist.
getInstance(string prefix = '') : \Joomla\CMS\Profiler\Profiler
since |
1.7.0 |
---|
Arguments
- prefix
string
Prefix used to distinguish profiler objects.
Response
\Joomla\CMS\Profiler\Profiler
The Profiler object.
getMarks
Get all profiler marks.
getMarks() : array
Returns an array of all marks created since the Profiler object was instantiated. Marks are objects as per {@link JProfiler::mark()}.
since |
1.7.0 |
---|
Response
array
Array of profiler marks
mark
Output a time mark
mark(string label) : string
since |
1.7.0 |
---|
Arguments
- label
string
A label for the time mark
Response
string
setStart
Sets the start time.
setStart(float startTime = 0.0, int startMem) : $this
since |
3.0.0 |
---|
Arguments
- startTime
float
Unix timestamp in microseconds for setting the Profiler start time.- startMem
int
Memory amount in bytes for setting the Profiler start memory.
Response
$this
For chaining