Timing
in package
Table of Contents
Properties
- $printed : bool
- Used to make sure we only print the run time once per run.
- $startTime : float
- The start time of the run.
Methods
- getDuration() : float
- Get the duration of the run up to "now".
- getHumanReadableDuration() : string
- Convert a duration in microseconds to a human readable duration string.
- printRunTime() : void
- Print information about the run.
- startTiming() : void
- Start recording time for the run.
Properties
$printed
Used to make sure we only print the run time once per run.
private
static bool
$printed
= false
$startTime
The start time of the run.
private
static float
$startTime
Methods
getDuration()
Get the duration of the run up to "now".
public
static getDuration() : float
Return values
float —Duration in microseconds.
getHumanReadableDuration()
Convert a duration in microseconds to a human readable duration string.
public
static getHumanReadableDuration(float $duration) : string
Parameters
- $duration : float
-
Duration in microseconds.
Return values
stringprintRunTime()
Print information about the run.
public
static printRunTime([bool $force = false ]) : void
Parameters
- $force : bool = false
-
If TRUE, prints the output even if it has already been printed during the run.
startTiming()
Start recording time for the run.
public
static startTiming() : void