It's probably already clear what I'm looking for, but I will describe it again. The task is to create something like setInterval, but so that it would be possible to change the delay time. I still hoped that everything can be done simply, but no ...
window.timeset = 1000; function play() { el = $('.main'); num = parseInt(el.text());; el.text(num+1); window.timeset = Math.random(); } setInterval(play, timeset);
I will need to change not one time, but each tick.