This looks to be a duplicate of Chrome: timeouts/interval suspended in background tabs?
If still relevant, this is a feature (?) of chrome, and a possible solution has already been described here How can I make setInterval also work when a tab is inactive in Chrome?
If you are using setTimeout or setInterval Chrome will slow them down and they will cease to fire as you'd expect. The proposed way around this is to basically write your own clock.
UPDATE
The examples in the other solution were a little more complex than they needed to be for this solution. To simplify the previous answer, you can use a HTML5 Web Worker to accomplish this. Here is a simple counter example taken from http://www.w3schools.com/html/html5_webworkers.asp (with minor editing):
page.html
<!DOCTYPE html>
<html>
<body>
<p>Count numbers: <output id="result"></output></p>
<button onclick="startWorker()">Start Worker</button>
<button onclick="stopWorker()">Stop Worker</button>
<br><br>
<script>
var w;
function startWorker()
{
if(typeof(Worker) !== "undefined")
{
if(typeof(w) == "undefined")
{
w = new Worker("worker.js");
}
w.onmessage = function (event) {
document.getElementById("result").innerHTML = event.data;
};
}
else
{
document.getElementById("result").innerHTML = "Unsupported!";
}
}
function stopWorker()
{
w.terminate();
}
</script>
</body>
</html>
worker.js
var i=0;
function timedCount()
{
i += 1;
postMessage(i);
setTimeout("timedCount()", 1000);
}
timedCount();
This should get you going.