Here you can find the source of repeat(interval)
Function.prototype.repeat = function(interval){ return setInterval(this, interval); };
function sleep(delay){ var start = new Date().getTime(); while (new Date().getTime() < start + delay);