mirror of
https://github.com/turuslan/HackTimer
synced 2024-11-22 15:54:49 +00:00
1 line
316 B
JavaScript
1 line
316 B
JavaScript
var f={};onmessage=function(e){var d=e.data,i=d.i,t=d.hasOwnProperty('t')?d.t:0;switch(d.n){case'a':f[i]=setInterval(function(){postMessage({i:i});},t);break;case'b':clearInterval(f[i]);delete f[i];break;case'c':f[i]=setTimeout(function(){postMessage({i:i});},t);break;case'd':clearTimeout(f[i]);delete f[i];break;}} |