Bug 17306 - The initial value of timestamp is not defined
The initial value of timestamp is not defined
Status: RESOLVED FIXED
Product: WebAppsWG
Classification: Unclassified
Component: Gamepad
unspecified
PC Linux
: P2 normal
: ---
Assigned To: Scott Graham
public-webapps-bugzilla
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-04 13:47 UTC by Olli Pettay
Modified: 2013-03-22 14:22 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Olli Pettay 2012-06-04 13:47:10 UTC
What should be the value of .timestamp when Gamepad object is
first time used?
Comment 1 Ted Mielczarek [:ted] 2012-06-04 16:47:01 UTC
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.
Comment 2 Scott Graham 2012-06-04 19:20:00 UTC
(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.
Comment 3 Ted Mielczarek [:ted] 2012-06-04 20:43:34 UTC
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)
Comment 4 Ted Mielczarek [:ted] 2012-06-05 00:35:36 UTC
Also, looks like HRTIME needs to get added to the Biblio DB, respec is complaining about that.
Comment 5 Ted Mielczarek [:ted] 2013-03-22 14:22:08 UTC
Cleaned this up a little more:
https://dvcs.w3.org/hg/gamepad/rev/27b047265c4d