Timer Timer(
[string|NULL
$category = NULL]
)
|
|
Constructor.
Parameters:
|
string|NULL |
$category: |
If a category is given the timer starts right away. |
Get a list of used categories.
integer get_count(
$category
)
|
|
Get number of timer resumes (includes start).
Parameters:
float get_current_microtime(
)
|
|
Get the current time in microseconds.
string get_duration(
string
$category, [integer
$decimals = 3]
)
|
|
Get the duration for a given category.
Parameters:
|
string |
$category: |
Category name |
|
integer |
$decimals: |
Number of decimals after dot. |
float get_microtime(
$category
)
|
|
Get the time in microseconds that was spent in the given category.
Parameters:
string get_state(
$category
)
|
|
Get the state a category timer is in.
Parameters:
API Tags:
| Return: | 'unknown', 'not initialised', 'running', 'paused' |
boolean pause(
$category
)
|
|
Pauses a timer category. It may me resumed later on, see resume().
NOTE: The timer needs to be started, either through the Constructor or the start() method.
Parameters:
API Tags:
| Return: | false, if the timer had not been started. |
Reset a timer category.
Parameters:
Resumes the timer on a category.
Parameters:
void start(
$category, [
$log = true]
)
|
|
Start a timer.
Parameters:
boolean stop(
$category
)
|
|
Stops a timer category. It may me resumed later on, see resume(). This is an alias for pause().
Parameters:
API Tags:
| Return: | false, if the timer had not been started. |