Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How reliable is interval? #185

Open
marcoscaceres opened this issue May 19, 2024 · 4 comments
Open

How reliable is interval? #185

marcoscaceres opened this issue May 19, 2024 · 4 comments

Comments

@marcoscaceres
Copy link
Member

marcoscaceres commented May 19, 2024

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?

@reillyeon
Copy link
Member

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.

@marcoscaceres
Copy link
Member Author

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.

@marcoscaceres marcoscaceres changed the title Interval seems confusing How reliable is Interval? May 21, 2024
@marcoscaceres marcoscaceres changed the title How reliable is Interval? How reliable is interval? May 21, 2024
@marcoscaceres
Copy link
Member Author

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.

@reillyeon
Copy link
Member

In Chromium at least it is hard-coded to 16ms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants