title: How to sleep the thread in node.js without affecting other threads?
body: <p>As per <a href="http://blog.mixu.net/2011/02/01/understanding-the-node-js-event-loop/">Understanding the node.js event loop</a>, node.js supports a single thread model. That means if I make multiple requests to a node.js server, it won't spawn a new thread for each request but will execute each request one by one.  It means if I do the following for the first request in my node.js code, and meanwhile a new request comes in on node, the second request has to wait until the first request completes, including 5 second sleep time.  Right?</p>
  
  <pre><code>var sleep = require('sleep');
      sleep.sleep(5)//sleep for 5 seconds
  </code></pre>
  
  <p>Is there a way that node.js can spawn a new thread for each request so that the second request does not have to wait for the first request to complete, or can I call sleep on specific thread only?</p>