var nativeSetInterval=window.setInterval;_setInterval={};window.setInterval=function(process,delay){var entry;if(typeof process=='string'){entry=new _setInterval.Entry(function(){eval(process)},delay)}else if(typeof process=='function'){entry=new _setInterval.Entry(process,delay)}else{throw Error('第一引数が不正です。');}var id=_setInterval.queue.length;_setInterval.queue[id]=entry return id};window.clearInterval=function(id){_setInterval.queue[id].loop=function(){}};_setInterval.queue=[];_setInterval.Entry=function(process,delay){this.process=process;this.delay=delay;this.time=0};_setInterval.Entry.prototype.loop=function(time){this.time+=time;while(this.time>=this.delay){this.process();this.time-=this.delay}};_setInterval.lastTime=new Date().getTime();nativeSetInterval(function(){var time=new Date().getTime();var subTime=time-_setInterval.lastTime;_setInterval.lastTime=time;for(var i=0;i<_setInterval.queue.length;i++){_setInterval.queue[i].loop(subTime)}},10);