-
Notifications
You must be signed in to change notification settings - Fork 8k
/
index.md
42 lines (26 loc) · 1.56 KB
/
index.md
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
---
title: Gamepad.timestamp
slug: Web/API/Gamepad/timestamp
---
{{APIRef("Gamepad API")}}
Свойство **`Gamepad.timestamp`** интерфейса {{domxref("Gamepad")}} возвращает {{domxref("DOMHighResTimeStamp")}}, представляющий собой время последнего обновления геймпада.
Идея состоит в том, чтобы позволить разработчику определить, были ли изменены данные для `axes` и `button` на аппаратном обеспечении. Значение должно быть установлено относительно атрибута `navigationStart` интерфейса `{{domxref("PerformanceTiming")}}`. Значения монотонно увеличиваются, поэтому их можно сравнивать, чтобы определить порядок изменений, т.к. новые значения всегда будут больше или равны старым.
> [!NOTE]
> В данный момент, это свойство нигде не поддерживается.
## Синтаксис
```
readonly attribute DOMHighResTimeStamp timestamp;
```
## Пример
```js
var gp = navigator.getGamepads()[0];
console.log(gp.timestamp);
```
## Значение
{{domxref("DOMHighResTimeStamp")}}.
## Спецификации
{{Specifications}}
## Совместимость с браузерами
{{Compat}}
## Смотрите также
[Using the Gamepad API](/ru/docs/Web/Guide/API/Gamepad)