3
I need to perform a function N times, but what I have done so far has not worked, remembering that N times has to be distributed equally by 1 second.
async function sendImage() {
Console.log('teste');
}
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function demo() {
while(true){
sendImage();
await sleep(1000/60);
}
}
demo();
No, it’s pure javascript.
– Lucas Caresia