Performance.now

performance.now() (DOM)

[1] performance オブジェクトnow メソッドは、 navigate 開始から起算した現在時刻を返します。

仕様書

現在高分解能時刻

[13] 現在高分解能時刻 (current high resolution time) は、 時刻起源から現在時刻 (present time) までの高分解能時刻です >>16Webブラウザーは、 これを表現する時計を保持する必要があります。

[5] この値は単調増加でなければなりませんシステム時計が変更されたとしても、それに影響されてはいけません。 >>11

[14] 現在高解像度時刻は、次の場面で使われます。

[3] 現在高解像度時刻の用法

[25] 現在時刻とは元期が異なります。

処理

[4] Performance オブジェクトnow メソッドは、 次のようにしなければなりません >>10

  1. [12] 現在高分解能時刻を返します。

安全性

[6] 利用者がある Webサイトを訪問したかどうかを、読み込みにかかった時間により (キャッシュの有無により変動することから) 推測することが可能であり、本メソッドによってより高精度に計測することができますが、新たな脅威ではないとされています。 >>2

[7] しかしそのような手法で実用上有用な精度で第三者サイトへの訪問の有無を判定できるかどうかは大変怪しいところです。

歴史

[9] High Resolution Time Level 2 ( 版) http://www.w3.org/TR/2013/WD-hr-time-2-20131203/

[17] define "current high resolution time" as primitive (#50) (igrigorik著, ) https://github.com/w3c/hr-time/commit/0adb0b46b3b8c83370e3525548a0d3ac594f435e

[18] Performance.now() should use an underlying primitive · Issue #44 · w3c/hr-time () https://github.com/w3c/hr-time/issues/44

[19] timeRemaining() is badly defined · Issue #54 · w3c/requestidlecallback () https://github.com/w3c/requestidlecallback/issues/54

[20] Define "current high resolution time" as primitive by igrigorik · Pull Request #50 · w3c/hr-time () https://github.com/w3c/hr-time/pull/50

[21] Use the current high resolution time concept (annevk著, ) https://github.com/whatwg/html/commit/9dbad6a2c9f24c9a7998997d2b1b337c2acd5a52

[22] Use the current high resolution time concept by annevk · Pull Request #3707 · whatwg/html () https://github.com/whatwg/html/pull/3707