title: javascript: setTimeout() not accurate
body: <p>if i use the setTimeout() function in Javascript, the script dont wait the exact time to trigger the code.</p>
  
  <p>here is an example:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>setTimeout(function(){ alert(''); }, 15000);</code></pre>
  </div>
  </div>
  </p>
  
  <p>Sometimes the alertbox get executed after 13-14 seconds, and sometimes after 16-17 seconds.</p>
  
  <p>why is it so and what can you do about it?</p>