performance.now in web workers

As one of the headlining features about web workers is to use them for
performance gains it makes sense to expose the sub-millisecond resolution
`now` function to web workers. As has been discussed numerous times,
Date.now is unreliable and inaccurate even at the millisecond resolution
and these inaccuracies can have a strong impact on performance- and
accuracy-sensitive applications.

The `navigation` and `timing` properties on `window.performance` do not
make sense in a worker context, so perhaps attaching the `now` function to
a worker's `self` object is the most straightforward? I'm sure others will
have better ideas for the API of this functionality.

Received on Monday, 24 September 2012 07:58:56 UTC