[3] [[DOM]] の[[データ型]] [DFN[[CODE(DOMi)@en[[[DOMHighResTimeStamp]]]]]] は、
高精度の[RUBY[[[時刻印]]][タイムスタンプ]]を表します。

* 仕様書

[REFS[
- [23] [CITE@en[High Resolution Time Level 2]] ([TIME[2016-02-26 04:49:50 +09:00]]) <https://w3c.github.io/hr-time/>
-- [24] [CITE@en[High Resolution Time Level 2]] ([TIME[2016-02-26 04:49:50 +09:00]]) <https://w3c.github.io/hr-time/#h-introduction>
-- [28] '''[CITE@en[High Resolution Time Level 2]] ([TIME[2016-02-26 04:49:50 +09:00]]) <https://w3c.github.io/hr-time/#h-dom-domhighrestimestamp>'''
]REFS]

* 意味

[29] [DFN[[CODE(DOMi)@en[DOMHighResTimeStamp]]]] は、
[FIG(list)[
- [30] [[時刻起源]]からの相対的な時間値
- [31] 2つの [CODE(DOMi)@en[DOMHighResTimeStamp]] の[[時間長]]
]FIG]
... のいずれかを表します [SRC[>>28]]。

[25] [CODE(DOMi)@en[DOMHighResTimeStamp]] は、既存の [CODE(JS)@en[Date]] や
[CODE(DOMi)@en[DOMTimeStamp]] では次のような場合に問題があるとして、導入されました
[SRC[>>24]]。
[FIG(list)[
- [26] [[単調増加]]であることが保証されないと、経過時間の計測や[[アニメーション]]の実装に使えません。
- [27] [[ミリ秒]]よりも更に精度がないと、[[アニメーション]]や[[音声]]の同期に使えません。
]FIG]

* 値

[4] [[Web IDL]] 的には [CODE(DOMi)@en[DOMHighResTimeStamp]] は[[型定義]]であり、
実際の[[データ型][データ型 (Web IDL)]]は [CODE(IDL)@en[double]] です [SRC[>>28]]。

[33] 値は、[[ミリ秒]]単位の[[時刻]]とする[SHOULD[べきです]] [SRC[>>28]]。

[32] 5[[マイクロ秒]]精度の値とする[SHOULD[べきです]] [SRC[>>28]]。
それが実現できない場合には、[[ミリ秒]]精度の値とすることができます [SRC[>>28]]。

[HISTORY[
[5] かつての規定では、[[ナノ秒]]の精度とする[SHOULD[べき]]、それが実現できない場合には、
[[ミリ秒]]の精度の値とすることができる [SRC[>>2]] とされていました。
]HISTORY]

;; [36] [[単位]]は [[ms]] なので、それより[[精度]]が高い時は、[[小数]]で表されます。

* 文脈

[34] [CODE(DOMi)@en[Performance]] API で使われています。

[35] [CODE(DOMm)@en[timeRemaining]] が返す残り時間の値として使われます。

[39] [CODE(DOMi)@en[Event]] [[インターフェイス]]の
[CODE(DOMa)@en[timeStamp]] [[IDL属性]]で使われています。

[60] 
[CODE[Window]]
の[F[最終活性化時刻印]]は、
[CODE[DOMHighResTimeStamp]]
または[[無限大]]です。

* 歴史

[REFS[
-[1] [CITE@en[Re: DOMHighResTimeStamp]]
( ([[Anne van Kesteren]] 著, [TIME[2012-10-10 01:54:20 +09:00]] 版))
<http://lists.w3.org/Archives/Public/public-script-coord/2012OctDec/0017.html>
-[2] [CITE@en[High Resolution Time]] ([TIME[2012-12-13 06:52:10 +09:00]] 版) <http://www.w3.org/TR/hr-time/#sec-DOMHighResTimeStamp>
]REFS]

[7] [CITE[IRC logs: freenode / #whatwg / 20140505]]
( ([TIME[2014-05-07 17:15:03 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20140505#l-231>

[8] [CITE@en[Re: ''''''[''''''whatwg'''''']'''''' Proposal: Event.creationTime]]
( ([[Anne van Kesteren]] 著, [TIME[2014-05-07 19:43:49 +09:00]] 版))
<http://lists.w3.org/Archives/Public/public-whatwg-archive/2014May/0051.html>

[9] [CITE[IRC logs: freenode / #whatwg / 20150611]]
([TIME[2015-06-12 11:59:46 +09:00]] 版)
<http://krijnhoetmer.nl/irc-logs/whatwg/20150611>

[10] [CITE@en[High Resolution Time Level 2]]
([TIME[2015-06-18 07:47:22 +09:00]] 版)
<http://www.w3.org/TR/2015/WD-hr-time-2-20150617/>

[11] [CITE@en[High Resolution Time Level 2]]
( ([TIME[2015-07-14 00:38:33 +09:00]] 版))
<http://www.w3.org/TR/2015/WD-hr-time-2-20150714/>

[12] [CITE@en[High Resolution Time Level 2]]
([TIME[2015-07-14 00:38:33 +09:00]] 版)
<http://www.w3.org/TR/2015/WD-hr-time-2-20150714/>

[13] [CITE@en[High Resolution Time Level 2]]
([TIME[2015-07-18 04:38:34 +09:00]] 版)
<http://www.w3.org/TR/2015/WD-hr-time-2-20150717/>

[14] [CITE@en[High Resolution Time Level 2]]
([TIME[2015-07-18 22:40:24 +09:00]] 版)
<http://www.w3.org/TR/2015/WD-hr-time-2-20150718/>

[15] [CITE@en[High Resolution Time Level 2]]
([TIME[2015-07-22 00:51:52 +09:00]] 版)
<http://www.w3.org/TR/2015/WD-hr-time-2-20150721/>

[16] [CITE@en-CA[event.timeStamp now returns DOMHighResTimeStamp on Nightly/Aurora for Linux (Affected) | Firefox Site Compatibility]]
( ([TIME[2016-06-20 01:03:12 +09:00]]))
<https://www.fxsitecompat.com/en-CA/docs/2015/event-timestamp-now-returns-domhighrestimestamp-on-nightly-aurora-for-linux/>

[17] [CITE@en[High resolution timing for events · Issue #23 · whatwg/dom]]
( ([TIME[2016-06-20 11:28:34 +09:00]]))
<https://github.com/whatwg/dom/issues/23>

[18] [CITE@en[77992 – Make Event.timeStamp return a DOMHighResTimeStamp on Windows (was Event.timeStamp should be relative to 1st January 1970 rather than the system start)]]
( ([TIME[2016-06-20 11:29:08 +09:00]]))
<https://bugzilla.mozilla.org/show_bug.cgi?id=77992>

[19] [CITE@en[1026804 – Make Event.timeStamp return a DOMHighResTimeStamp by default (switch on pref)]]
( ([TIME[2016-06-20 11:33:40 +09:00]]))
<https://bugzilla.mozilla.org/show_bug.cgi?id=1026804>

[20] [CITE@en[receivedTime and upcoming DOM update · Issue #145 · WebAudio/web-midi-api]]
( ([TIME[2016-06-20 11:37:25 +09:00]]))
<https://github.com/WebAudio/web-midi-api/issues/145>

[21] [CITE@en['''['''whatwg''']''' Proposal: Event.creationTime]]
( ([[Brian Birtles]]著, [TIME[2014-05-07 14:51:25 +09:00]]))
<https://lists.w3.org/Archives/Public/public-whatwg-archive/2014May/0046.html>

[22] [CITE@en[Issue 574514 - chromium - MSE conformance test failure related to event.timeStamp - Monorail]]
( ([TIME[2016-06-20 11:45:00 +09:00]]))
<https://bugs.chromium.org/p/chromium/issues/detail?id=574514>

[6] [CITE[High Resolution Timestamps for Events | Web Updates - Google Developers]]
( ([TIME[2016-05-19 01:39:56 +09:00]]))
<https://developers.google.com/web/updates/2016/01/high-res-timestamps>

[37] [CITE@en[Large rewrite/refactoring of the spec (#156)]]
([[tobie]]著, [TIME[2017-01-26 09:59:32 +09:00]])
<https://github.com/w3c/sensors/commit/615141fdd299e63e221a87d27f83766f345829e9>

[38] [CITE@en[Make Event's timeStamp use DOMHighResTimeStamp]]
([[majido]]著, [TIME[2017-07-13 16:38:55 +09:00]])
<https://github.com/whatwg/dom/commit/912d58746bc4c67c2fd210124639f7c34991fce5>

[40] [CITE@en[High resolution timing for events · Issue #23 · whatwg/dom]]
([TIME[2017-07-14 23:42:53 +09:00]])
<https://github.com/whatwg/dom/issues/23>

[41] [CITE@en[High resolution timing for events · Issue #23 · whatwg/dom]]
([TIME[2017-07-15 00:22:30 +09:00]])
<https://github.com/whatwg/dom/issues/23>

[42] [CITE@en[Update Event.timeStamp type to DOMHighResTimeStamp. by majido · Pull Request #420 · whatwg/dom]]
([TIME[2017-07-15 00:22:45 +09:00]])
<https://github.com/whatwg/dom/pull/420>

[43] [CITE@en[Is DOMHighResTimeStamp a "JSON type"? · Issue #504 · heycam/webidl]]
([TIME[2018-01-03 18:02:18 +09:00]])
<https://github.com/heycam/webidl/issues/504>

[44] [CITE@en[Temporarily reducing precision of DOMHighResTimeStamp in Chrome]]
([[Ross McIlroy]]著, [TIME[2018-01-08 21:22:12 +09:00]])
<https://lists.w3.org/Archives/Public/public-web-perf/2018Jan/0005.html>

[45] [CITE[Actions required to mitigate Speculative Side-Channel Attack techniques - The Chromium Projects]]
([TIME[2018-01-09 10:37:14 +09:00]])
<https://www.chromium.org/Home/chromium-security/ssca>

[46] [CITE@en-US[Mitigating speculative execution side-channel attacks in Microsoft Edge and Internet Explorer - Microsoft Edge Dev BlogMicrosoft Edge Dev Blog]]
([TIME[2018-01-09 11:13:06 +09:00]])
<https://blogs.windows.com/msedgedev/2018/01/03/speculative-execution-mitigations-microsoft-edge-internet-explorer/>

[47] [CITE@en-US[Mitigations landing for new class of timing attack | Mozilla Security Blog]]
([TIME[2018-01-09 11:23:51 +09:00]])
<https://blog.mozilla.org/security/2018/01/03/mitigations-landing-new-class-timing-attack/>

[48] [CITE@en[Speculative execution side-channel attack ("Spectre") — Mozilla]]
([TIME[2018-01-09 11:25:51 +09:00]])
<https://www.mozilla.org/en-US/security/advisories/mfsa2018-01/>

[49] [CITE[What Spectre and Meltdown Mean For WebKit | WebKit]]
([TIME[2018-01-11 15:22:44 +09:00]])
<https://webkit.org/blog/8048/what-spectre-and-meltdown-mean-for-webkit/>

[50] [CITE@en[metric -> name, value -> duration, duration as DOMHighResTimestamp]]
([[Charles Vazac]]著, [TIME[2017-07-26 05:37:08 +09:00]])
<https://github.com/w3c/server-timing/commit/48fcadffbb8ec4cf23404f681c607b2146c76078>

[51] [CITE@en[165503 – performance.now() should truncate to 100us]]
([TIME[2018-01-09 23:46:21 +09:00]])
<https://bugs.webkit.org/show_bug.cgi?id=165503>

[52] [CITE@en[Temporarily reducing precision of DOMHighResTimeStamp in Chrome]]
([[Ross McIlroy]]著, [TIME[2018-01-08 21:22:12 +09:00]])
<https://lists.w3.org/Archives/Public/public-web-perf/2018Jan/0005.html>

[53] [CITE@en[Add a note regarding HRT precision (#57)]]
([[plehegar]]著, [TIME[2018-02-28 23:25:12 +09:00]])
<https://github.com/w3c/hr-time/commit/c7924fffdca73f8cf5ee057450a4ad9a5a73d645>

[54] [CITE@en[Add a note regarding HRT precision by plehegar · Pull Request #57 · w3c/hr-time]]
([TIME[2018-05-08 21:44:50 +09:00]])
<https://github.com/w3c/hr-time/pull/57>

[55] [CITE@en[Removed minimum resolution mention from SOTD]]
([[plehegar]]著, [TIME[2018-03-01 01:37:40 +09:00]])
<https://github.com/w3c/hr-time/commit/5220e4b80d62c4784c214dd66935e51366210680>

[56] [CITE@en[Define the reference clock used for RTCRtpContributingSource.timestamp (]]
([[taylor-b]]著, [TIME[2018-05-17 14:08:54 +09:00]])
<https://github.com/w3c/webrtc-pc/commit/2820f6095ba81e018355260c4fdb801f311f4417>

[57] [CITE@en[RTCRtpContributingSource.timestamp needs a clearer definition · Issue #1690 · w3c/webrtc-pc]]
([TIME[2018-05-19 11:34:02 +09:00]])
<https://github.com/w3c/webrtc-pc/issues/1690>

[58] [CITE@en[Not possible to tell how old `RTCRtpContributingSource.timestamp` is · Issue #1497 · w3c/webrtc-pc]]
([TIME[2018-05-19 11:34:12 +09:00]])
<https://github.com/w3c/webrtc-pc/issues/1497>

[59] [CITE@en[Define the reference clock used for RTCRtpContributingSource.timestamp by taylor-b · Pull Request #1854 · w3c/webrtc-pc]]
([TIME[2018-05-19 11:34:19 +09:00]])
<https://github.com/w3c/webrtc-pc/pull/1854>