This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 17306 - The initial value of timestamp is not defined
Summary: The initial value of timestamp is not defined
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Gamepad (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Scott Graham
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-04 13:47 UTC by Olli Pettay
Modified: 2013-03-22 14:22 UTC (History)
4 users (show)

See Also:


Attachments

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