JavaScript事件时间戳不一致 [英] JavaScript event timestamps not consistent
问题描述
1376344365954000一样。为什么有这个区别?
谢谢
timeStamp 返回时间以来的毫秒数量: 用于指定创建事件的 然而,对epoch没有严格的定义: 纪元时间的例子是系统开始的时间或1970年1月1日0:0:0 UTC 有些事件使用第一个变量(系统启动),而其他事件使用自1970年以来的时间。作为一个方面说明,可能有一些事件并没有提供 I notice that when I click one element on my site e.timeStamp is reported by Firebug in the event handler as a 9-digit number, like 866523917, and when I click a different element e.timeStamp is reported in that handler by Firebug as a 16-digit number, like
1376344365954000. Why the difference? Thanks As defined in standard Used to specify the time (in milliseconds relative to the epoch) at
which the event was created. Due to the fact that some systems may not
provide this information the value of timeStamp may be not available
for all events. When not available, a value of 0 will be returned. However, there is no strict definition for epoch: Examples of epoch time are the time of the system start or 0:0:0 UTC
1st January 1970. Some events are using first variant (system start) while others use time since 1970. Hence the difference. As a side note it's possible that 这篇关于JavaScript事件时间戳不一致的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
< blockquote>
的时间(相对于纪元的毫秒数)。由于某些系统不能
提供这些信息,因此对于所有事件,timeStamp的值可能不可用
。当不可用时,将返回0值。
。
timeStamp
,那么它的值将是 0
。 timeStamp
returns number of milliseconds since epoch:
timeStamp
is not provided at all for some events, then its value will be 0
.