I want to execute a function every specified seconds, and it should loop forever. When the function is finished I want to start a new setTimeout using a random generated value between 2 and 5 (represents seconds).
Maybe badly explained but..
this is what I have so far.
function Start() {
let count = $("section.mosaic").find("a.item").length;
ChangePic();
setTimeout(function () {
let interval = CREATOR.PUB.Utility.randomInterval(2, 5);
console.log(interval);
}, 3000);
function ChangePic() {
}
}