blob: 6f7aeaba05b95805e358eac3a7066e3e770d75a1 (
plain)
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
|
---
title: Gamepad.timestamp
slug: Web/API/Gamepad/timestamp
tags:
- API
- Gamepad API
- Games
- NeedsBetterSpecLink
- NeedsMarkupWork
- Property
- Reference
- Référence(2)
translation_of: Web/API/Gamepad/timestamp
---
<div>{{APIRef("Gamepad API")}}</div>
<p>{{domxref("Gamepad")}} インターフェースの <strong><code>Gamepad.timestamp</code></strong> プロパティは、このゲームパッドのデータが最後に更新された時刻を表す {{domxref("DOMHighResTimeStamp")}} を返します。</p>
<p>このプロパティの背景にある考え方は、ハードウェアにより <code>axes</code> や <code>button</code> のデータが更新されたかどうかを開発者が判断できるようにすることです。このプロパティの値は <code>{{domxref("PerformanceTiming")}}</code> インターフェースの <code>navigationStart</code> 属性との相対的な値になります。値は単調増加しています。つまり、新しい値は常に古い値以上であるため、新旧の値を比較することでデータの更新を判断できます。</p>
<div class="note">
<p><strong>注釈</strong>: このプロパティは現在サポートされていない環境があります。</p>
</div>
<h2 id="構文">構文</h2>
<pre class="syntaxbox notranslate"><span class="idlInterface" id="idl-def-Gamepad"><span class="idlAttribute">readonly attribute <span class="idlAttrType">DOMHighResTimeStamp</span> <span class="idlAttrName">timestamp</span>;</span></span></pre>
<h2 id="例">例</h2>
<pre class="brush: js notranslate">var gp = navigator.getGamepads()[0];
console.log(gp.timestamp);</pre>
<h2 id="値">値</h2>
<p>{{domxref("DOMHighResTimeStamp")}} 。</p>
<h2 id="仕様">仕様</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">仕様</th>
<th scope="col">状態</th>
<th scope="col">コメント</th>
</tr>
<tr>
<td>{{SpecName("Gamepad", "#dom-gamepad-timestamp", "Gamepad.timestamp")}}</td>
<td>{{Spec2("Gamepad")}}</td>
<td>初版</td>
</tr>
</tbody>
</table>
<h2 id="ブラウザの互換性">ブラウザの互換性</h2>
<p>{{Compat("api.Gamepad.timestamp")}}</p>
<h2 id="参照">参照</h2>
<p><a href="/ja/docs/Web/Guide/API/Gamepad">ゲームパッド API の使用</a></p>
|