26 lines
290 B
JavaScript
26 lines
290 B
JavaScript
var i=0;
|
|
var update = null;
|
|
function timedCount(){
|
|
|
|
onmessage = (e) => {
|
|
|
|
|
|
if(e.data == "on"){
|
|
|
|
update = setInterval("passerupdate()", 200);
|
|
}
|
|
|
|
if(e.data == "off"){
|
|
clearInterval(update);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
function passerupdate(){
|
|
|
|
postMessage("up");
|
|
}
|
|
|
|
timedCount();
|