/
68.txt
150 lines (111 loc) · 6.8 KB
/
68.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
[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属性]]で使われています。
* 歴史
[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>