JProfiler
class JProfiler extends JObject
Utility class to assist in the process of benchmarking the execution of sections of code to understand where time is being spent.
Methods
Constructor
Sets a default value if not alreay assigned
Returns a property of the object or the default value if the property is not set.
Returns an associative array of object properties.
Get the most recent error message.
Modifies a property of the object, creating it if it does not already exist.
Set the object properties based on a named array/hash.
Returns the global Profiler object, only creating it if it doesn't already exist.
Output a time mark
Get the current time.
Get information about current memory usage.
Get all profiler marks.
Details
at line 70
JObject
__construct(string $prefix = '')
Constructor
in JObject at line 56
string
__toString()
Magic method to convert the object to a string gracefully.
in JObject at line 70
mixed
def(string $property, mixed $default = null)
Sets a default value if not alreay assigned
in JObject at line 88
mixed
get(string $property, mixed $default = null)
Returns a property of the object or the default value if the property is not set.
in JObject at line 107
array
getProperties(boolean $public = true)
Returns an associative array of object properties.
in JObject at line 133
string
getError(integer $i = null, boolean $toString = true)
Get the most recent error message.
in JObject at line 165
array
getErrors()
Return all errors, if any.
in JObject at line 180
mixed
set(string $property, mixed $value = null)
Modifies a property of the object, creating it if it does not already exist.
in JObject at line 198
boolean
setProperties(mixed $properties)
Set the object properties based on a named array/hash.
in JObject at line 222
void
setError(string $error)
Add an error message.
in JObject at line 235
string
toString()
deprecated
deprecated
at line 87
static JProfiler
getInstance(string $prefix = '')
Returns the global Profiler object, only creating it if it doesn't already exist.
at line 114
string
mark(string $label)
Output a time mark
The mark is returned as text enclosed in
at line 153
static float
getmicrotime()
Get the current time.
at line 168
integer
getMemory()
Get information about current memory usage.
at line 201
array
getBuffer()
Get all profiler marks.
Returns an array of all marks created since the Profiler object was instantiated. Marks are strings as per {@link JProfiler::mark()}.