How does jQuery's .delay method work under-the-hood?
<p>I just saw this and think it's cool.</p>

<pre><code>console.log("Starting...");
$("#my_element")
  .fadeIn()
  .delay(3000)
  .fadeOut();
console.log("Finishing...");
</code></pre>

<p>How does the .delay method work under-the-hood?  I mean, how does it figure out how to wait 3 seconds but not interrupt the main control flow?</p>
