performance.now
1306 ワード
performance.now()
The returned value represents the time elapsed since the time origin .
Example
const t0 = performance.now();
doSomething();
const t1 = performance.now();
console.log(`Call to doSomething took ${t1 - t0} milliseconds.`);
Copy to Clipboard
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()
.
performance.now()=>システムクロック測定のタイムスタンプ値(マイクロ秒精度).
Reference
この問題について(performance.now), 我々は、より多くの情報をここで見つけました
https://velog.io/@hqillz/performance.now
テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol
const t0 = performance.now();
doSomething();
const t1 = performance.now();
console.log(`Call to doSomething took ${t1 - t0} milliseconds.`);
Reference
この問題について(performance.now), 我々は、より多くの情報をここで見つけました https://velog.io/@hqillz/performance.nowテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol