How to execute multiple functions on mutliple objects at the same time in javascript?
<p>Say I have 5 different javascript timers that start ticking when I click "start", each are referenced in variable timer1, timer2, timer3, timer4, timer5.</p>

<p>If these timers were each in an array, I would have to do something like this in pseudocode:</p>

<pre><code>foreach timer in timerarray {
    timer.stop;
    timer.setstoptime(time that it stopped);
}
</code></pre>

<p>The issue here is that if I were to get "getstoptime", due to having to iterate through the array for each timer, all the timers would have different values for the time that they stopped. Is there some way to keep track of all the timers and make it such that when I click on stop, if I were to be able to retrieve their stop time, all of them would be identical?</p>

<p>I know this is unlikely to happen with javascript iterating through arrays very fast, but because the array has to iterate, there is a small time gap before each timer stops. </p>

<p>I am looking for a way to ensure that all get "stop" executed on them simultaneously. If someone can provide some kind of sample code and some recommendation how to ensure this happens would be great. </p>
