title: Faster code execution when placing setTimeout with zero delay at the beginning of the function: why that happens?
body: <p>In the following article, <code>use-case 1</code>, they change positions of the <code>setTimeout</code> call inside the <code>count</code> function:</p>
  <p><a href="https://javascript.info/event-loop#use-case-1-splitting-cpu-hungry-tasks" rel="nofollow noreferrer">https://javascript.info/event-loop#use-case-1-splitting-cpu-hungry-tasks</a></p>
  <p>In the second case its much faster and they explain it by the following sentence:</p>
  <blockquote>
  <p>If you run it, it’s easy to notice that it takes significantly less
  time.</p>
  <p>Why?</p>
  <p>That’s simple: as you remember, there’s the in-browser minimal delay
  of 4ms for many nested setTimeout calls. Even if we set 0, it’s 4ms
  (or a bit more). So the earlier we schedule it – the faster it runs.</p>
  </blockquote>
  <p>For me it's a very unclear explanation and I don't understand what they mean at all. Could anyone explain more clearly and in detail why these two cases take different time?</p>