title: Non-blocking code in Node.js not working
body: <p>I'm trying to learn how to create non-blocking applications in node.js but my code doesn't seem to be working.</p>
  
  <p>nonblocking.js</p>
  
  <pre><code>var http = require('http');
  var exec = require('child_process').exec;
  
  var userRequests = 0;
  http.createServer(function (request, response) {
      userRequests++;
  
      response.writeHead(200, {'Content-Type': 'text/plain'});
  
      if( userRequests == 1 ){
          exec("node wait.js", function(){
              response.write('Thanks for waiting!');
              response.end();
          });
      }
      else{
          response.write('Hello!');
          response.end();
      }
  }).listen(8080);
  
  console.log('Server start');
  </code></pre>
  
  <p>wait.js</p>
  
  <pre><code>var startTime = new Date().getTime();
  while (new Date().getTime() &lt; startTime + 15000);
  </code></pre>