Reputation: 63
I need to run a function every fixed time with maximum precision. For example, every 30 milliseconds a function will run. I tried this code:
this.interval = setInterval(() => {
this.foo();
}, 30);
But when I add the number of actions called in a certain time period with another time period of the same length, I get a different number!
Is there a way to solve this? That the accuracy in running the functions will be the same?
Upvotes: 0
Views: 44