In my web application I use recursive setTimeout() to call a function every second (see below).
function test() { console.log(\'test\'); setTimeout(test,