A click providing the current time in nanoseconds, backed by hrtime
.
More...
A click providing the current time in nanoseconds, backed by hrtime
.
- Since
- 1.43
- Access: internal
Definition at line 12 of file Clock.php.
◆ __construct()
Wikimedia\Telemetry\Clock::__construct |
( |
| ) |
|
◆ getCurrentNanoTime()
Wikimedia\Telemetry\Clock::getCurrentNanoTime |
( |
| ) |
|
Get the current time, represented as the number of nanoseconds since the UNIX epoch.
- Returns
- int
Definition at line 37 of file Clock.php.
◆ setMockTime()
static Wikimedia\Telemetry\Clock::setMockTime |
( |
?int | $epochNanos | ) |
|
|
static |
Set a mock time to override the timestamp returned by Clock::getCurrentNanoTime()
.
Useful for testing.
- Parameters
-
int | null | $epochNanos | The override timestamp, or null to return to using the current time. |
- Returns
- void
Definition at line 49 of file Clock.php.
The documentation for this class was generated from the following file: