title: Is performance.now() in web workers reliable?
body: <p>I have this long running script that is being executed by a dedicated web worker, and I want to know how long time the execution takes, in real world time.</p>
  
  <pre><code>time1 = performance.now();   
  doSomethingSyncronous();
  time2 = performance.now();
  doSomethingAsyncronous(function() {
     time3 = performance.now();
  }
  doSomethingSyncrounous();
  time4 = performance.now();
  </code></pre>
  
  <p>In this example I want time2-time1 to be the actual duration of doSomethingSyncronous(), in the same way I want time3-time2 to be the actual duration of doSomethingAsyncrounous. </p>
  
  <p>I would like to think that the worker threads can sleep whenever the CPU wants to, and the duration measured with performance.now() would be incorrect. Is that a kind of correct assumption? In that case, what would be the correct way of measuring duration in web workers?</p>
  
  <p>Thanks!</p>