Ver originalfunction getInterval() { return Math.random() * 1000;} function doMyTasks() { console.log(+new Date);} setTimeout(function tick() { doMyTasks(); setTimeout(tick, getInterval());}, 500);