I need to run a function N times, but what I did so far did not work, remembering that this N times have to be evenly distributed for 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();