I’m trying to output some data every 0.1 seconds or any other fixed interval of time, is there a function to do this? I’ve heard Observable could work, but I can’t get my head around to using them. Thanks!
Why don’t use the good old setInterval
?
setInterval(() => {
//Do some stuff
}, 100);
1 Like
Yeap, already got this one, and even better I think is this way:
function printSome() {
if(count < 10) {
count++;
console.log(count);
setTimeout(printSome, 500);
}
}
printSome();