# event.timeStamp

## event.timeStamp ( ) Returns: Number version added: 1.2.6

Description: The difference in milliseconds between the time the browser created the event and January 1, 1970.

This property can be useful for profiling event performance by getting the `event.timeStamp` value at two points in the code and noting the difference. To simply determine the current time inside an event handler, use `(new Date).getTime()` instead.

Note: Due to a bug open since 2004, this value is not populated correctly in Firefox and it is not possible to know the time the event was created in that browser.

## Examples:

#### Example: Display the time since the click handler last executed.

    <!doctype html>
    <html lang="en">
    <head>
      <meta charset="utf-8">
      <title>css demo</title>

      <style>

      div {
        height: 100px;
        width: 300px;
        margin: 10px;
        background-color: #ffd;
        overflow: auto;
      }

      </style>

      <script src="//code.jquery.com/jquery-1.10.2.js"></script>
    </head>
    <body>

    <div>Click.</div>

    <script>

    var last, diff;
    $( "div" ).click(function( event ) {
      if ( last ) {
        diff = event.timeStamp - last;
        $( "div" ).append( "time since last event: " + diff + "<br>" );
      } else {
        $( "div" ).append( "Click again.<br>" );
      }
      last = event.timeStamp;
    });

    </script>

    </body>
    </html>

#### Demo: