Nossos voluntários ainda não traduziram este artigo para o Português (do Brasil) . Junte-se a nós e ajude a fazer o trabalho!
Summary
Returns the time (in milliseconds) at which the event was created.
Syntax
event.timeStamp
Examples
var number = event.timeStamp;
The following is a more complete example:
<html> <head> <title>timeStamp example</title> <script type="text/javascript"> function getTime(event) { document.getElementById("time").firstChild.nodeValue = event.timeStamp; } </script> </head> <body onkeypress="getTime(event)"> <p>Press any key to get the current timestamp for the onkeypress event.</p> <p>timeStamp: <span id="time">-</span></p> </body> </html>
Notes
This property only works if the event system supports it for the particular event.
Specifications
Specification | Status | Comment |
---|---|---|
DOM The definition of 'Event.timeStamp' in that specification. |
Living Standard | |
DOM4 The definition of 'Event.timeStamp' in that specification. |
Recommendation | |
Document Object Model (DOM) Level 2 Events Specification The definition of 'Event.timeStamp' in that specification. |
Recommendation | Initial definition. |
Browser compatibility
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | 49.0[1] | ? | ? | ? | ? |
Feature | Android | Android Webview | Firefox Mobile (Gecko) | Firefox OS | IE Mobile | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|---|
Basic support | No support | 49.0[1] | ? | ? | ? | ? | ? | 49.0 |
[1] Starting with Chrome 49, returns a high-resolution monotonic time instead of epoch time.
Etiquetas do documento e colaboradores
Etiquetas:
Colaboradores desta página:
teoli,
jpmedley,
cvrebert,
dgashmdn,
fscholz,
kosvrouvas,
kscarfone,
rashidtherash,
Kartik_Chadha,
Sheppy,
ethertank,
ziyunfei,
Matej Lednar,
Dao,
Jabez,
Ptak82,
Nickolay,
Wampa,
Dria,
JesseW
Última atualização por:
teoli,