michael@0: var count = 0; michael@0: function timerFunction() { michael@0: if (++count == 30) { michael@0: close(); michael@0: postMessage("ready"); michael@0: while (true) { } michael@0: } michael@0: } michael@0: michael@0: for (var i = 0; i < 10; i++) { michael@0: setInterval(timerFunction, 500); michael@0: }