Re: DOMHighResTimeStamps in DOM events, use cases

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 UTC