W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2012

Re: DOMHighResTimeStamps in DOM events, use cases

From: Jonas Sicking <jonas@sicking.cc>
Date: Mon, 4 Jun 2012 00:23:25 -0700
Message-ID: <CA+c2ei96s=OBQkzGm3=N8X9gDAbLtvSH5dkHhMwH5J6K3WaaHw@mail.gmail.com>
To: Pablo Garaizar Sagarminaga <garaizar@deusto.es>
Cc: www-dom@w3.org
On Sun, Jun 3, 2012 at 10:49 AM, Pablo Garaizar Sagarminaga
<garaizar@deusto.es> wrote:
> Hello,
>
> on Tue, 29 May 2012 20:41:08 -0700 James Robinson <jamesr@google.com>
> wrote:
>
>> Please come up with a list of cases where this timestamp would be
>> useful and start a new thread on www-dom@w3.org explaining your use
>> cases and how you think this proposal would help.  I agree that this
>> could be quite useful.  It would probably be handled as part of DOM4
>> events.
>
> Let's start compiling a list of use cases where DOMHighResTimeStamps in
> DOM events would be very useful:
>
> #1 Synchronization of multimedia sources and animations
>
> Accurate synchronization of several multimedia sources through events
> (e.g. timeupdate) and running animations via requestAnimationFrame API
> which already uses DOMHighResTimeStamp would be much easier if DOM
> events provided high resolution timestamps.
>
> #2 Accurate user-generated response-times
>
> User-generated response times (keyboard, mouse, touch-screen) could
> be gathered with sub-millisecond accuracy relative to a running
> animation (RequestAnimationFrame) or a perfomance.now() high resolution
> timestamp. Considering the event timestamp is defined when the event is
> created, this high resolution timestamp would be sub-millisecond
> accurate even if the event is dispatched late in an overloaded event
> queue.
>
> #3 Accurate event-capable benchmarks
>
> Compare User Timing API's perfomance measures (starttime, duration)
> with event high resolution timestamps to perform event-capable
> accurate benchmarks.

I'm not quite understanding the difference between #2 and #3. That
said, I have two additional use cases.

#4 Accurate responses in games. For example in a rock-band style game,
the user attempts to hit the key exactly at a specific time.

#5 Fluid behavior for animations. If an animation is started in
response to a user event, but the main thread happens to be busy when
the event should fire, the page can account for this and place
animated items where they would be as if the animation had started
exactly when the user event occurred.

/ Jonas
Received on Monday, 4 June 2012 12:45:53 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:09 GMT