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()
我擔心這是否會正常工作時,一堆請求來瞬間,或將異步打破它/混淆次?