php8.5
Home/ Manual/ reference / hrtime/ High resolution timing

High resolution timing

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.

Intro

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.

Setup Examples Performancecounter Stopwatch Unit

Source: reference/hrtime/book.xml · from the official PHP manual (php/doc-en)