Timer
in package
Class Timer.
Table of Contents
- $marks : array<string|int, mixed>
- $testsCount : int
- __construct() : mixed
- Timer constructor.
- addMark() : static
- diff() : array<string, string>
- getMark() : array<string, string>|false
- getMarks() : array<string, array<string, mixed>>
- setMark() : static
- test() : array<string, string>
Properties
$marks
protected
array<string|int, mixed>
$marks
= []
$testsCount
protected
int
$testsCount
= 1
Methods
__construct()
Timer constructor.
public
__construct() : mixed
Return values
mixed —addMark()
public
addMark(string $name) : static
Parameters
- $name : string
Return values
static —diff()
public
diff(string $from, string $to) : array<string, string>
Parameters
- $from : string
- $to : string
Return values
array<string, string> —Two keys: memory in MB and time in seconds
getMark()
public
getMark(string $name) : array<string, string>|false
Parameters
- $name : string
Return values
array<string, string>|false —getMarks()
public
getMarks([bool $format = false ]) : array<string, array<string, mixed>>
Parameters
- $format : bool = false
Return values
array<string, array<string, mixed>> —setMark()
public
setMark(string $name, int $memoryUsage, float $microtime) : static
Parameters
- $name : string
- $memoryUsage : int
- $microtime : float
Return values
static —test()
public
test(int $times, callable $function[, bool $flush = false ]) : array<string, string>
Parameters
- $times : int
- $function : callable
- $flush : bool = false
Return values
array<string, string> —Two keys - "memory" in MB and "time" in seconds