Chrome reports an invalid event.timeStamp value (6 digits or negative values)

I have the following code

$("p").on( "mousemove", function(event) { $("p").text(event.timeStamp); }); 

It returns a 9-digit positive value in Firefox and Edge, but in Chrome, only a six-digit decimal number. My version of chrome is 43. What is wrong here?

EDIT . I updated the version of Chrome, but still get either negative time values ​​or a six-digit number. Now my version of Chrome is 48. I am using Window 10 64 bit if that matters.

EDIT 2 . When I reload my page, the value will be positive for a short period of time. After that, it becomes negative. A negative value decreases with time and finally becomes positive and continues to grow.

+8
javascript jquery
source share
2 answers

In chrome (version 48/49 ... m) event.timeStamp returns a float value, something like 18000.123 ..

I just stopped using event.timeStamp, and instead I set Date.now (), which is not so accurate, but to avoid this problem.

link

+2
source share

It seems to me that event.timeStamp now milliseconds, starting from page loading, and not milliseconds since January 1, 1970 00:00:00 (as defined in the specification).

I check this by comparing event.timeStamp with performance.now() , which are the same.

+2
source share

All Articles