4 ms·
Workers don't expose accurate time afaik to mitigate Meltdown/Spectre [0], but wouldn't their free-to-use NTP server work for your usecase? https://www.cloudfla
by ignoramous 6y ago
Workers don't expose accurate time afaik to mitigate Meltdown/Spectre [0], but wouldn't their free-to-use NTP server work for your usecase? https://www.cloudflare.com/time/ https://www.cloudflare.com/time/
[0] https://developers.cloudflare.com/workers/about/security/ https://developers.cloudflare.com/workers/about/security/
- kentonv 6y agoWorkers can read the clock, but the clock doesn't advance while the worker is executing, which prevents it from using the clock to measure its own execution time. For a service that just returns the current time, that shouldn't make a difference.
- devwastaken 6y agoUsing an ntp server voids the point of using workers over http to browsers. Workers are at the endpoint in the world closest to the user, which is less latency, so you can guarantee time better.