title: Is there a more accurate way to create a Javascript timer than setTimeout?
body: <p>Something that has always bugged me is how unpredictable the <code>setTimeout()</code> method in Javascript is.</p>
  
  <p>In my experience, the timer is horribly inaccurate in a lot of situations. By inaccurate, I mean the actual delay time seems to vary by 250-500ms more or less. Although this isn't a huge amount of time, when using it to hide/show UI elements the time can be visibly noticeable.</p>
  
  <p>Are there any tricks that can be done to ensure that <code>setTimeout()</code> performs accurately (without resorting to an external API) or is this a lost cause?</p>