[1] [CODE(DOMa)@en[[[performance]]]] [[オブジェクト]]の [DFN[[CODE(DOMm)@en[now]]]]
[[メソッド]]は、 [[navigate]] 開始から起算した[[現在]]の[[時刻]]を返します。

* 仕様書

[REFS[
- [10] '''[CITE@en[High Resolution Time Level 2]] ([TIME[2016-02-26 04:49:50 +09:00]]) <https://w3c.github.io/hr-time/#dom-performance-now>'''
- [16] [CITE@en[High Resolution Time Level 2]] ([TIME[2017-07-28 01:03:15 +09:00]]) <https://w3c.github.io/hr-time/#dfn-current-high-resolution-time>
- [11] [CITE@en[High Resolution Time Level 2]] ([TIME[2016-02-26 04:49:50 +09:00]]) <https://w3c.github.io/hr-time/#h-monotonic-clock>
]REFS]

* 現在高分解能時刻

[13] [DFN[[RUBYB[現在高分解能時刻]@en[current high resolution time]]]]は、
[[時刻起源]]から[RUBYB[[[現在時刻]]]@en[present time]]までの[[高分解能時刻]]です [SRC[>>16]]。
[[Webブラウザー]]は、
これを表現する[[時計][時計 (Web)]]を保持する必要があります。

[5] この値は[[単調増加][単調増加時計]]でなければ[MUST[なりません]]。
[[システム時計]]が変更されたとしても、それに影響されてはいけません。
[SRC[>>11]]

[14] [[現在高解像度時刻]]は、次の場面で使われます。

[FIG(middle list)[ [3] [[現在高解像度時刻]]の用法
- [CODE[Performance.now]]
- [[イベントループ]]
- [[アイドル期間]]の開始
- [[アイドルコールバック群呼び出しアルゴリズム]]
- [[アイドルコールバックタイムアウト呼び出しアルゴリズム]]
- [CODE(DOMm)@en[timeRemaining]]
- [[イベントコンストラクター]]
- [CODE(DOMm)@en[createEvent]]
- [[user activation]]
]FIG]

[25] [[現在時刻]]とは[[元期]]が異なります。

* 処理

[4] [CODE(DOMi)@en[Performance]] [[オブジェクト]]の 
[DFN[[CODE(DOMm)@en[now][Performance.now]]]] [[メソッド]]は、
次のようにしなければ[MUST[なりません]] [SRC[>>10]]。

[FIG(steps)[
= [12] [[現在高分解能時刻]]を返します。
]FIG]

* 安全性

[6] [[利用者]]がある [[Webサイト]]を訪問したかどうかを、読み込みにかかった時間により (キャッシュの有無により変動することから)
推測することが可能であり、本メソッドによってより高精度に計測することができますが、新たな脅威ではないとされています。
[SRC[>>2]]

;; [7] しかしそのような手法で実用上有用な精度で第三者サイトへの訪問の有無を判定できるかどうかは大変怪しいところです。

* 歴史

- [2] [CITE@en[High Resolution Time]] ([TIME[2012-12-13 06:52:10 +09:00]] 版) <http://www.w3.org/TR/hr-time/#sec-extenstions-performance-interface>

[9] [CITE@en[High Resolution Time Level 2]]
([TIME[2013-11-27 03:50:20 +09:00]] 版)
<http://www.w3.org/TR/2013/WD-hr-time-2-20131203/>

[17] [CITE@en[define "current high resolution time" as primitive (#50)]]
([[igrigorik]]著, [TIME[2017-07-27 03:26:02 +09:00]])
<https://github.com/w3c/hr-time/commit/0adb0b46b3b8c83370e3525548a0d3ac594f435e>

[18] [CITE@en[Performance.now() should use an underlying primitive · Issue #44 · w3c/hr-time]]
([TIME[2017-08-19 21:22:45 +09:00]])
<https://github.com/w3c/hr-time/issues/44>

[19] [CITE@en[timeRemaining() is badly defined · Issue #54 · w3c/requestidlecallback]]
([TIME[2017-08-19 21:23:53 +09:00]])
<https://github.com/w3c/requestidlecallback/issues/54>

[20] [CITE@en[Define "current high resolution time" as primitive by igrigorik · Pull Request #50 · w3c/hr-time]]
([TIME[2017-08-19 21:24:18 +09:00]])
<https://github.com/w3c/hr-time/pull/50>

[21] [CITE@en[Use the current high resolution time concept]]
([[annevk]]著, [TIME[2018-05-23 22:58:47 +09:00]])
<https://github.com/whatwg/html/commit/9dbad6a2c9f24c9a7998997d2b1b337c2acd5a52>

[22] [CITE@en[Use the current high resolution time concept by annevk · Pull Request #3707 · whatwg/html]]
([TIME[2018-05-31 00:18:33 +09:00]])
<https://github.com/whatwg/html/pull/3707>

