Skip to content

MonotonicClock ​

Rasuvaeff\PropertyTesting\Runner\MonotonicClock

Class — Package: property-testing-core — Source — Version: v1.0.0-1-g88fdee2

Implements: Runner\Clock

The default Clock: hrtime(), monotonic and immune to a wall-clock adjustment mid-run.

Deadlines and time budgets measure elapsed time, and a clock that can step backwards would report a negative one. PSR-20 is deliberately not used here: it answers "what time is it" in DateTimeImmutable, which is the wall clock this class exists to avoid.

Methods ​

nanoseconds() ​

php
nanoseconds(): int

Current reading of a monotonic clock, in nanoseconds. Only differences between two readings are meaningful.

Documentation inherited from Runner\Clock.