← TechnologyThe essentials of

performance.now(): short interval measurement

Publisher: ResumeMaker • 1 source

Published: 22 Oct 2026 13:13 · Updated: 22 Oct 2026 13:13

AI source check: 21 Oct 2026 10:06. This is not editorial approval.

In a few sentences

In brief

performance.now() returns a time value in milliseconds relative to the environment’s time origin.

Useful to know

performance.now() returns a time value in milliseconds relative to the environment’s time origin. It is intended for measuring intervals rather than displaying calendar dates. [1]

Record const start = performance.now();, perform the operation, then calculate const elapsed = performance.now() - start;. The result is the interval in milliseconds. There is no fixed result for this demonstration because it depends on the actual execution.

For asynchronous work, decide whether the measurement covers only starting the operation or waiting for it to finish. Measuring immediately after starting a request does not cover its complete lifetime.

One attempt cannot establish that an algorithm is universally faster. Data, device, load and runtime warm-up affect the result. Distinguish a demonstration of the measuring method from a real comparison.

Sources

For further detail and to check the information:

  1. [1] MDN — Performance.now ↗