event.timeStamp

event.timeStamp Returns: Number

Description: This attribute returns the number of milliseconds since January 1, 1970, when the event is triggered.

  • version added: 1.2.6event.timeStamp

Example:

Alert the time since click handler last executed.

<!DOCTYPE html>
<html>
<head>
  <script src="https://code.jquery.com/jquery-latest.js"></script>
</head>
<body>

<script>var last;
$(document.body).click(function(event) {
   if( last )
      alert( "time since last event " + event.timeStamp - last );
   last = event.timeStamp;
});  </script>
</body>
</html>

Demo:

Result: