Knowing that while Node.js is working asynchronously, writing something like this:
function sleep() { var stop = new Date().getTime(); while(new Date().g
You are calling sleep right away, and the new sleep function blocks. It keeps iterating until the condition is met. You should use setTimeout() to avoid blocking:
sleep
setTimeout()
setTimeout(function () { console.log('done sleeping'); }, 15000);