Maybe it's a stupid question but how can I determine the millisecond to delay the calling of a method ? For example if I have multiple delayed calls:
var par=100;
var millisecondsToDelay=40;
for (i=0;i<par;i++){
window.setTimeout(function() {
myfunction();
}, millisecondsToDelay);
}
And the function "myfunction" takes the average of 0.5 seconds to be executed. How can I determine which is the best millisecond to delay? there is a logic I can take into account or it's just something I have to test? Thank you in advance.