Nodejs Time Delay Delay(function)

Here you can find the source of Delay(function)

Method Source Code

window.Delay = (function(){
   var timer = 0;
   return function(callback, ms){
      clearTimeout (timer);// w  w  w .  j a  v  a  2  s .c o  m
      timer = setTimeout(callback, ms);
   };
})();

Related

  1. delay(timeout)
    Function.prototype.delay = function(timeout){
      return setTimeout(this, timeout);
    };