0
我使用http.createServer(onRequest)
创建了一个http服务器,并且要测量做出响应所需的时间。node.js process.hrtime在异步服务器?
目前,我onRequest
处理我做的:
var start = process.hrtime();
response.on('end', function(){
console.log('time to respond', process.hrtime(start));
});
// call various asynchronous functions and send them 'response' object. One of them eventually does response.end()
我担心这是否会正常工作时,一堆请求来瞬间,或将异步打破它/混淆次?