function mySetInterval(fn, milliSec,count){ function interval(){ if(typeof count==='undefined'||count-->0){ setTimeout(interval, milliSec); try{ fn() }catch(e){ t = 0; throw e.toString(); } } } setTimeout(interval, milliSec) }
转载于:https://www.cnblogs.com/lizhang4/p/9049566.html