From aef87c07094e69c8eea15ef6a41432dc6ad755a1 Mon Sep 17 00:00:00 2001 From: AminaG Date: Mon, 21 Mar 2016 21:35:37 +0200 Subject: [PATCH] Update index.js --- index.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/index.js b/index.js index 5166550..798e1a3 100644 --- a/index.js +++ b/index.js @@ -74,3 +74,33 @@ }; }()); + + +// Fox for timeout issue; +;(function(){ + var _org=setTimeout; + var number=1; + var max=100 + setTimeout=function(func,n){ + if(!n) n=0 + if(number==100) number=1; + if(n<100) + n+= ++number + else + n-= ++number + console.log('setTimeout:',n) + return _org.apply(this,[func,n]) + } + })(); + ;(function(){ + var _org=setInterval; + var number=1; + var max=100 + setInterval=function(func,n){ + if(!n) n=0 + if(number==100) number=1; + n+=++number + console.log('setInterval:',n) + return _org.apply(this,[func,n]) + } + })();