W3C home > Mailing lists > Public > public-device-apis-log@w3.org > May 2017

Re: [sensors] Define processing model

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
Message-ID: <issue_comment.created-304286431-1495806382-sysbot+gh@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

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 12:18:53 UTC