Documentation

Timing
in package

Table of Contents

Constants

MINUTE_IN_MS  : int = 60000
Number of milliseconds in a minute.
SECOND_IN_MS  : int = 1000
Number of milliseconds in a second.

Properties

$printed  : bool
Used to make sure we only print the run time once per run.
$startTime  : float
The start time of the run in microseconds.

Methods

getDuration()  : float
Get the duration of the run up to "now".
getHumanReadableDuration()  : string
Convert a duration in milliseconds to a human readable duration string.
printRunTime()  : void
Print information about the run.
startTiming()  : void
Start recording time for the run.

Constants

MINUTE_IN_MS

Number of milliseconds in a minute.

public int MINUTE_IN_MS = 60000

SECOND_IN_MS

Number of milliseconds in a second.

public int SECOND_IN_MS = 1000

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 in microseconds.

private static float $startTime

Methods

getDuration()

Get the duration of the run up to "now".

public static getDuration() : float
Return values
float —

Duration in milliseconds.

getHumanReadableDuration()

Convert a duration in milliseconds to a human readable duration string.

public static getHumanReadableDuration(float $duration) : string
Parameters
$duration : float

Duration in milliseconds.

Return values
string

printRunTime()

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
On this page

Search results