English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The 'event.timeStamp' property returns the number of milliseconds from the first mouse left button down to the last lift.
By obtaining the event.timeStamp value at two points in the code and noting the difference, this property is very useful for analyzing event performance.
event.timeStamp
Return the milliseconds consumed from the first mouse left button down to the last mouse up:
$("button").click(function(event) { $("span").text(event.timeStamp); });Test and See‹/›
Display the time since the last execution of the click handler:
$("document").ready(function() { let last, diff; $("button").click(function(event) { if (last) { diff = event.timeStamp - last; $("p").text("Milliseconds since the last activity: " + last); + diff); } $("p").text("Click the button again."); } last = event.timeStamp; }); });Test and See‹/›
Parameters | Description |
---|---|
event | eventParameters from Event Binding Feature |