just simulate an exec by doing setTimeout(function () { etc }, Math.floor(Math.random() * (400 - 100 + 1)) + 100);