requestAnimationFrame: what exactly is the timestamp?

后端 未结 3 1508
伪装坚强ぢ
伪装坚强ぢ 2021-02-20 11:15

I have always thought that timestamp used by requestAnimationFrame is the same as usual timestamp in JavaScript, that is number of milliseconds since January 1st, 1970. Today I

3条回答
  •  滥情空心
    2021-02-20 11:57

    MDN says:

    The callback has one single argument, a DOMHighResTimeStamp, which indicates the current time (the time returned from performance.now() )

    And this is what performance.now() returns:

    The returned value represents the time elapsed since the time origin.

    The time origin is a standard time which is considered to be the beginning of the current document's lifetime.

提交回复
热议问题