title: Simple setInterval timer stalling on tab blur in Safari
body: <p>I've got a simple timer that I built that works off of a setInterval function. Every 1 second, it increases the value of the timer by 1. When I click off of the tab to a different tab in Safari, it slows down. You can see what I'm talking about in this basic CodePen:</p>
  
  <p><a href="http://codepen.io/anon/pen/rxVMRp" rel="nofollow">http://codepen.io/anon/pen/rxVMRp</a></p>
  
  <p>This is the basic JS code:</p>
  
  <pre><code>function setTimer(){
    var curTime = parseInt($('.timer').text());
    var newTime = curTime+1;
    $('.timer').text(newTime);
  }
  
  setInterval(setTimer, 1000);
  </code></pre>
  
  <p>Granted, my timer is a bit more advanced, but you can still see the slow down effect of setInterval in Safari in this basic example. How can I prevent this slow down without having to offload anything to a web worker?</p>