This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
What should be the value of .timestamp when Gamepad object is first time used?
It should probably be the timestamp from when the connected event happened. (When the gamepad was first exposed to script.) We should probably clarify what the values of .timestamp are. I think we have two sane options: 1) Equivalent to Date.now(), milliseconds since the epoch (limited time resolution depending on platform). 2) Equivalent to the High Resolution Time spec's DOMHighResTimeStamp values. (fractional milliseconds since page load): http://www.w3.org/TR/2012/WD-hr-time-20120313/#sec-DOMHighResTimeStamp Better resolution + spec'ed to be monotonic.
(In reply to comment #1) > It should probably be the timestamp from when the connected event happened. > (When the gamepad was first exposed to script.) > > We should probably clarify what the values of .timestamp are. I think we have > two sane options: > 1) Equivalent to Date.now(), milliseconds since the epoch (limited time > resolution depending on platform). > 2) Equivalent to the High Resolution Time spec's DOMHighResTimeStamp values. > (fractional milliseconds since page load): > http://www.w3.org/TR/2012/WD-hr-time-20120313/#sec-DOMHighResTimeStamp Better > resolution + spec'ed to be monotonic. I think DOMHighResTimeStamp would be best to coordinate with audio, rAF, etc. I will update if there's no objection to that.
That sounds fine to me. I see you already made a change to reference the HighRes Time spec, but don't forget to actually fix the subject of this bug while you're at it. :) (defining the default value of .timestamp)
Also, looks like HRTIME needs to get added to the Biblio DB, respec is complaining about that.
Cleaned this up a little more: https://dvcs.w3.org/hg/gamepad/rev/27b047265c4d