Whats faster in Javascript a bunch of small setInterval loops, or one big one?
- by RobertWHurst
Just wondering if its worth it to make a monolithic loop function or just add loops were they're needed.
The big loop option would just be a loop of callbacks that are added dynamically with an add function.
adding a function would look like this
setLoop(function(){
alert('hahaha! I\'m a really annoying loop that bugs you every tenth of a second');
});
setLoop would add the function to the monolithic loop.
so is the is worth anything in performance or should I just stick to lots of little loops using setInterval?