Re: Specifying window.performance.now()

On Wed, Feb 29, 2012 at 1:26 AM, David Mandelin <dmandelin@mozilla.com> wrote:
> [4.2] "A DOMHighResTimeStamp represents a number of milliseconds"
>
> Was milliseconds chosen for compatibility with other timing APIs? Seconds seems nicer conceptually but I understand if all the other related APIs are already ms.

The two other spec that I can think of that use timing in a similar
fashion is requestAnimationFrame and Navigation/Resource Timing. Both
use milliseconds as unit so it makes sense to me to align with them
for easier math.

> [4.3] "On getting, the now attribute MUST return the number of milliseconds from the start of the navigation of the root document to the occurrence of the call to the now attribute."
>
> The main application of Performance.now seems to be relative timing, which doesn't particularly require any origin. It seems to me to be a bit easier to allow an arbitrary origin, so that the implementation doesn't have to track a zero time and subtract. Do some important applications require zero to be start of navigation?

It might be interesting to align with requestAnimationFrame. It
currently uses Jan 1st 1970 as 0 time though there's a note that that
might change. See step 2 in
http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/RequestAnimationFrame/Overview.html#processingmodel

I don't have a strong opinion either way though.

/ Jonas

Received on Wednesday, 29 February 2012 14:27:15 UTC