0

I have a timer in my website, which ticks every second using setInterval()

It does work well, but when I change the tab, the timer gets slower.

When the window is hidden, the timer gets slow. How can I fix this??

I am using safari 8.0.7.

Minjae Kwak
  • 185
  • 1
  • 2
  • 8
  • You need to post your code so others can inspect which part cause a heavy CPU load. Otherwise, nobody is clarified on what's going on on your code. – TaoPR Jun 07 '15 at 05:42
  • This code "var i = 0; setInterval(function(){ i++; console.log(i); },1000);" gets slower when I put this in about:blank using javascript console. It is not the problem with my website – Minjae Kwak Jun 07 '15 at 05:44
  • We need either code or a link to help you... – Tomer Almog Jun 07 '15 at 05:47
  • Another related answer: [Chrome: timeouts/interval suspended in background tabs?](http://stackoverflow.com/questions/6032429/chrome-timeouts-interval-suspended-in-background-tabs/6032591#6032591) – jfriend00 Jun 07 '15 at 06:04

0 Answers0