w3c / compute-pressure

A web API proposal that provides information about available compute capacity
https://www.w3.org/TR/compute-pressure/
Other
69 stars 10 forks source link

data delivery: Set `timestamp` as an "unsafe shared current time" #280

Closed rakuco closed 5 months ago

rakuco commented 5 months ago

Follow-up to #274, related to #257.

The wording used in #274, which mentions platform-specific timestamps, made more sense in the context of the Generic Sensor API spec, as multiple platform-specific sensor APIs provide samples with timestamps in a platform-specific format that needs to be converted.

Of the OS-provided telemetry APIs, however, only Windows optionally provides samples with a timestamp. As such, it makes more sense to define a timestamp using the monotonic clock's unsafe current time instead. Aditionally, the accompanying note was rewritten to indicate that the same value should be used for all globals, otherwise the same sample would end up with different "raw" timestamps in different frames/workers.


Preview | Diff

rakuco commented 5 months ago

@arskama sorry for flip-flopping on the contents here; this only occurred to me when I tried to integrate your changes from #274 into #265.

arskama commented 5 months ago

LGTM. It makes sense! Thanks for fixing it. I also had doubts about the wording, I should have challenged more myself and you on the meaning of this sentence.