Timings
in package
Represents a Stopwatch with timing points.
Table of Contents
Methods
- __construct() : mixed
- getLaps() : array<string|int, TimingPoint>
- Returns timing points.
- getStopwatch() : Stopwatch
- Gets the underlying stopwatch object.
- isRunning() : bool
- Checks whether the underlying stopwatch is running.
- lap() : void
- Record a timing point.
- start() : void
- Starts the underlying stopwatch.
- stop() : void
- Stops the underlying stopwatch.
Methods
__construct()
public
__construct([Stopwatch|null $sw = null ]) : mixed
Parameters
- $sw : Stopwatch|null = null
-
Stopwatch to measure timing points from, null to start a new one.
getLaps()
Returns timing points.
public
getLaps() : array<string|int, TimingPoint>
Return values
array<string|int, TimingPoint> —Timing points.
getStopwatch()
Gets the underlying stopwatch object.
public
getStopwatch() : Stopwatch
Return values
Stopwatch —Stopwatch object.
isRunning()
Checks whether the underlying stopwatch is running.
public
isRunning() : bool
Return values
bool —true if it is running.
lap()
Record a timing point.
public
lap(string $name[, string $comment = '' ]) : void
Parameters
- $name : string
-
Timing point name, must be alphanumeric.
- $comment : string = ''
-
Timing point comment.
Tags
start()
Starts the underlying stopwatch.
public
start() : void
stop()
Stops the underlying stopwatch.
public
stop() : void