title: non-blocking setTimeout in javascript vs sleep in ruby
body: <p>So, in javascript since it's event-driven by its nature it seems that setTimeout doesn't block. This means that if I do this:</p>
  
  <pre><code>setTimeout(function(){
    console.log('sleeping');
  }, 10);
  console.log('prints first!!');
  </code></pre>
  
  <p>It will output <code>'prints first!!'</code> and then <code>'sleeping'</code>.</p>
  
  <p>The js interpreter won't wait until setTimeout is done instead it executes the piece of code below it right away. When 10ms passes, then it executes the callback function.</p>
  
  <p>Now I have been playing around with ruby recently. I know that it has non-blocking support in event-machine library. But I wonder if we can achieve something similar to setTimeout example I have just written in javascript with <code>sleep</code> or any function in ruby natively without event-machine support? Is this possible at all using closure proc or block or anything? Thanks. </p>