There are libraries for high precision timers in node.js
and there is the window.performance.now()
for the main thread https://stackoverflow.com/a/21120901/1056563. Is there anything for web-workers (which do not have access to window
or the DOM
)?
There's a performance
property on WorkerGlobalScope
. It's not super-widely supported, but then again neither are web workers.
Specifically, .now()
is (apparently) available to web workers, if that's all you need.