W3C home > Mailing lists > Public > public-web-perf@w3.org > February 2012

Re: Specifying window.performance.now()

From: Jonas Sicking <jonas@sicking.cc>
Date: Wed, 29 Feb 2012 15:26:13 +0100
Message-ID: <CA+c2ei_wy6zrzAshfRV8Arqhue4TdxeWTZo9rDU+YKiUWDuo_A@mail.gmail.com>
To: David Mandelin <dmandelin@mozilla.com>
Cc: Jatinder Mann <jmann@microsoft.com>, Tony Gentilcore <tonyg@google.com>, public-web-perf@w3.org, James Robinson <jamesr@google.com>, Luke Wagner <lw@mozilla.com>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 29 February 2012 14:27:16 GMT