We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

현재 번역은 완벽하지 않습니다. 한국어로 문서 번역에 동참해주세요.

performance.now() 메서드는 1000 분의 5 밀리 초(5 마이크로 초) 로 정밀하게 밀리 초 단위로 측정된 DOMHighResTimeStamp 를 반환한다.

반환된 값은 time origin (the PerformanceTiming.navigationStart property) 이후로 경과된 시간을 나타낸다. In a web worker, the time origin is the time that its execution context (e.g. thread or process) is created. In a window, it is the time that the user navigated (or confirmed navigation, if confirmation was needed) to the current document. Bear in mind the following points:

  • In dedicated workers created from a Window context, the value in the worker will be lower than performance.now() in the window who spawned that worker. It used to be the same as t0 of the main context, but this was changed.
  • In shared or service workers, the value in the worker might be higher than that of the main context because that window can be created after those workers.


t = performance.now();


var t0 = performance.now();
var t1 = performance.now();
console.log("Call to doSomething took " + (t1 - t0) + " milliseconds.");

Unlike other timing data available to JavaScript (for example Date.now), the timestamps returned by Performance.now() are not limited to one-millisecond resolution. Instead, they represent times as floating-point numbers with up to microsecond precision.

Also unlike Date.now(), the values returned by Performance.now() always increase at a constant rate, independent of the system clock (which might be adjusted manually or skewed by software like NTP). Otherwise, performance.timing.navigationStart + performance.now() will be approximately equal to Date.now().


Specification Status Comment
High Resolution Time Level 2
The definition of 'performance.now()' in that specification.
Candidate Recommendation Stricter definitions of interfaces and types.
High Resolution Time
The definition of 'performance.now()' in that specification.
Recommendation Initial definition

Browser compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari
Basic support 20.0 webkit
24.0 [1]
(Yes) 15.0 (15.0) 10.0 15.0 8.0
on Web workers 33 ? 34.0 (34.0) ? ? ?
now() in a dedicated worker is now separate from the main context's now(). ? ? 45.0 (45.0) ? ? ?
Feature Android Android Webview Edge Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support 4.0 25.0 (Yes) 15.0 (15.0) 10.0 No support 9 25.0
on Web workers ? (Yes) ? 34.0 (34.0) ? ? ? (Yes)
now() in a dedicated worker is now separate from the main context's now(). ? ? ? 45.0 (45.0) ? ? ? ?

[1] Windows versions of Chrome 20 through 33 return performance.now() only to millisecond precision.

See also

문서 태그 및 공헌자

이 페이지의 공헌자: Dong-Young_Lee, dragmove
최종 변경: Dong-Young_Lee,