summaryrefslogtreecommitdiffstats
path: root/dom/workers/test/suspend_worker.js
blob: 43eb24a7ad338944de9d31de0c6e34227a467c79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/**
 * Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/
 */
var counter = 0;

var interval = setInterval(function() {
  postMessage(++counter);
}, 100);

onmessage = function(event) {
  clearInterval(interval);
}