- From: Mikhail Pozdnyakov via GitHub <sysbot+gh@w3.org>
- Date: Fri, 26 May 2017 13:46:24 +0000
- To: public-device-apis-log@w3.org
> By occupying resources during rendering. Especially if complex filtering is done on them.
That's quite a generic problem if you do too much stuff in a regularly invoked JS callback you can 'jank' renderer using any API :)
If developer wants to sync sensor with rAF s/he can always use `requestAnimationFrame` directly:
```
const sensor = new Sensor({ frequency: 60 });
function draw(timestamp) {
window.requestAnimationFrame(draw);
let x = sensor.x;
// Drawing ...
}
sensor.onactivate => { window.requestAnimationFrame(draw); }
sensor.start();
```
--
GitHub Notification of comment by pozdnyakov
Please view or discuss this issue at https://github.com/w3c/sensors/issues/198#issuecomment-304286431 using your GitHub account
Received on Friday, 26 May 2017 13:46:30 UTC