Web APIs

performance.now()

Try the free JavaScript compiler

Returns a monotonic time reading in milliseconds relative to the current environment time origin; resolution may be reduced.

Formal Syntax & Structure

javascript syntaxjavascript
performance.now()

Return Value

number

Milliseconds relative to time origin.

Working Example

Example Snippetjavascript
(async () => {const start=performance.now(); const values=[1,2,3].map(n=>n*2); const elapsed=performance.now()-start; console.log(values.join(","),elapsed>=0);})()
JavaScript Reference