Documentation

PHP_Timer
in package

Utility class for timing.

Table of Contents

$requestTime  : float
$startTimes  : array<string|int, mixed>
$times  : array<string|int, mixed>
resourceUsage()  : string
Returns the resources (time, memory) of the request as a string.
secondsToTimeString()  : string
Formats the elapsed time as a string.
start()  : mixed
Starts the timer.
stop()  : float
Stops the timer and returns the elapsed time.
timeSinceStartOfRequest()  : string
Formats the elapsed time since the start of the request as a string.

Properties

$requestTime

public static float $requestTime

$startTimes

private static array<string|int, mixed> $startTimes = array()

$times

private static array<string|int, mixed> $times = array('hour' => 3600000, 'minute' => 60000, 'second' => 1000)

Methods

resourceUsage()

Returns the resources (time, memory) of the request as a string.

public static resourceUsage() : string
Return values
string

secondsToTimeString()

Formats the elapsed time as a string.

public static secondsToTimeString(float $time) : string
Parameters
$time : float
Return values
string

start()

Starts the timer.

public static start() : mixed
Return values
mixed

stop()

Stops the timer and returns the elapsed time.

public static stop() : float
Return values
float

timeSinceStartOfRequest()

Formats the elapsed time since the start of the request as a string.

public static timeSinceStartOfRequest() : string
Return values
string

Search results