switch=true execTime:number throttle(fn,interval){ if(new Date().getTime()-this.execTime>interval){this.switch=true} if(this.switch){ fn(); this.switch=false; this.execTime=new Date().getTime(); } }