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

Re: [sensors] Does SensorReading always need a timeStamp ?

From: Rijubrata Bhaumik via GitHub <sysbot+gh@w3.org>
Date: Wed, 11 May 2016 07:44:21 +0000
To: public-device-apis@w3.org
Message-ID: <issue_comment.created-218385986-1462952660-sysbot+gh@w3.org>
Atleast on Android side, SensorEvent provides timestamps.

``` java
public void onSensorChanged(SensorEvent event) {
     if (event.sensor.getType() == Sensor.TYPE_LIGHT) {
          mLastUpdate.illuminance = event.values[0];
          mLastUpdate.timestamp = event.timestamp;
     }
} 

```


-- 
GitHub Notification of comment by riju
Please view or discuss this issue at 
https://github.com/w3c/sensors/issues/105#issuecomment-218385986 using
 your GitHub account
Received on Wednesday, 11 May 2016 07:44:23 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 14:54:08 UTC