rt-sim-training-client/static/workertest/passsimulation/passer.js
2020-05-28 13:39:41 +08:00

26 lines
289 B
JavaScript

var i=0;
var update = null;
function timedCount(){
onmessage = (e) => {
if(e.data == "on"){
update = setInterval("passerupdate()", 50);
}
if(e.data == "off"){
clearInterval(update);
}
}
}
function passerupdate(){
postMessage("up");
}
timedCount();