Open marcoscaceres opened 6 months ago
I've always interpreted interval
as a promise to fire the event at a particular implementation-defined rate. That is, timestamp
tells you when the event was generated and interval
tells you when to expect the next one. This is important for motion events because they represent rates of change.
Note that devicemotion
events are fired at a fixed interval while deviceorientation
events (which represent a position rather than a change in position) fire whenever there is significant change.
Ok, yeah, that makes sense. I haven't check, but it would be interesting to see how reliable interval is and it changes in any way.
I guess I'm also wondering if it does change, then why does it change... for instance, if it changes because of battery or anything else (e.g., the phone gets plugged in), it might be a privacy leak.
In Chromium at least it is hard-coded to 16ms.
The
interval
attribute assumes that the user agent will fire the event, which doesn't make much sense because the user agent could fire as little or as often as it wants (based on a significant change of motion) and other environmental conditions.Couldn't the interval between events be more accurately been gleamed from comparing the
.timeStamp
between two events?