High resolution timing
Introduction
The HRTime extension implements a high resolution StopWatch class. It uses the best possible APIs on different platforms which brings resolution up to nanoseconds. It also makes possible to implement a custom stopwatch using low level ticks delivered by the underlying APIs.
Note: As of PHP 7.3.0 the related function hrtime() is part of the core.
- Installing/Configuring
- Examples
- HRTime\PerformanceCounter — The HRTime\PerformanceCounter class
- HRTime\PerformanceCounter::getFrequency — Timer frequency in ticks per second
- HRTime\PerformanceCounter::getTicks — Current ticks from the system
- HRTime\PerformanceCounter::getTicksSince — Ticks elapsed since the given value
- HRTime\StopWatch — The HRTime\StopWatch class
- HRTime\StopWatch::getElapsedTicks — Get elapsed ticks for all intervals
- HRTime\StopWatch::getElapsedTime — Get elapsed time for all intervals
- HRTime\StopWatch::getLastElapsedTicks — Get elapsed ticks for the last interval
- HRTime\StopWatch::getLastElapsedTime — Get elapsed time for the last interval
- HRTime\StopWatch::isRunning — Whether the measurement is running
- HRTime\StopWatch::start — Start time measurement
- HRTime\StopWatch::stop — Stop time measurement
- HRTime\Unit — The HRTime\Unit class
↑ and ↓ to navigate • Enter to select • Esc to close • / to open