Class: Timer
Source Location: /blogs/b2evocore/_timer.class.php
Class Timer
Class Overview
|
This is a simple class to allow timing/profiling of code portions. Located in /blogs/b2evocore/_timer.class.php [line 46] |
[ Top ]
Method Summary
| Timer | Timer() | Constructor. |
| void | display_time() | |
| float | get_current_microtime() | Get the current time in microseconds. |
| string | get_duration() | |
| float | get_microtime() | Get the time in microseconds that was spent in the given category. |
| string | get_state() | Get the state a category timer is in. |
| boolean | pause() | Pauses a timer category. It may me resumed later on, see resume(). |
| void | reset() | Reset a timer category. |
| void | resume() | Resumes the timer on a category. |
| void | start() | Start a timer. |
| boolean | stop() | Stops a timer category. It may me resumed later on, see resume(). This is an alias for pause(). |
[ Top ]
Properties
Methods
Constructor Timer [line 63]
|
Constructor.
Parameters:| string|NULL | $category: | If a category is given the timer starts right away. |
[ Top ]
display_time [line 145]
|
| $category: | ||
| $decimals: |
[ Top ]
get_current_microtime [line 211]
|
Get the current time in microseconds.
[ Top ]
get_duration [line 156]
|
| $category: | ||
| $decimals: |
[ Top ]
get_microtime [line 167]
|
Get the time in microseconds that was spent in the given category.
Parameters:| $category: |
[ Top ]
get_state [line 190]
|
Get the state a category timer is in.
Parameters:| $category: |
API Tags:
| Return: | 'unknown', 'not initialised', 'running', 'paused' |
[ Top ]
pause [line 110]
|
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:| $category: |
API Tags:
| Return: | false, if the timer had not been started. |
[ Top ]
resume [line 128]
|
Resumes the timer on a category.
Parameters:| $category: |
[ Top ]
