title: setInterval pauses in Android Browser / Mobile Safari when screen times out
body: <p>I've built a simple JavaScript-based timer for a mobile webapp; for the sake of example:</p>
  
  <pre><code>var a = 0;
  setInterval(function() {
      console.log('a', a);
      a++;
  }, 1000);
  </code></pre>
  
  <p>This runs just fine in both Mobile Safari and Android Browser. It will log to console every second and increment the value of a accordingly. (Okay, Android Browser doesn't have console.log support, but let's assume it does.)</p>
  
  <p><b>The issue:</b> if the screen times out (i.e. user stopped interacting with the page), the setInterval function pauses. It resumes when the user turns on their screen again. This won't work for me as I need timer to keep running.</p>
  
  <p><b>The questions:</b> Is there a way to prevent the setInterval function from pausing when the screen times out? If not, is it possible to prevent the screen from timing out? Any other alternatives?</p>
  
  <p>Thanks in advance!</p>