Let reportingInterval be the result of 1 / reportingFrequency.
Let timestampDelta be the result of latest reading["timestamp"] - lastReportedTimestamp.
If timestampDelta is greater than or equal to reportingInterval
[...]
reportingFrequency is measured in Hz, so reportingInterval is measured in seconds. latest reading["timestamp"] and lastReportedTimestamp, on the other hand, are high resolution timestamps measured in milliseconds.
A timestampDelta of 2 means a different of two milliseconds, while a sampling frequency of 1Hz means reportingInterval is 1 and the check above will be true even though it should not.
https://w3c.github.io/sensors/#report-latest-reading-updated has:
reportingFrequency
is measured in Hz, soreportingInterval
is measured in seconds.latest reading["timestamp"]
andlastReportedTimestamp
, on the other hand, are high resolution timestamps measured in milliseconds.A
timestampDelta
of 2 means a different of two milliseconds, while a sampling frequency of 1Hz meansreportingInterval
is 1 and the check above will be true even though it should not.