ibms-dome/FrontendWebApi/wwwroot/js/workers/workers.js

21 lines
342 B
JavaScript
Raw Permalink Normal View History

2022-10-14 16:08:54 +08:00
var time = true;
var tt = 0;
function timer() {
//console.log("haha");
if (tt < 5) {
postMessage(tt + "分鐘前");
tt++;
} else {
tt = 0
postMessage("ok");
};
console.log(tt);
}
if (time) {
var myVar = setInterval(function () { timer() }, 60000);
time = false;
}