res, next){! var start = new Date;! res.on('header', function(){! var ms = new Date - start;! res.setHeader('X-Response-Time', ms + 'ms');! });! next();! }); ! ! // response! ! app.use(function(req, res, next){! res.send(200, "Hello World");! }); // koa! ! // response time! ! app.use(function *(next){! var start = new Date;! yield next;! var ms = new Date - start;! this.set('X-Response-Time', ms + 'ms');! });! ! // response! ! app.use(function *(){! this.body = 'Hello World';! }); HFOFSBUPSZJFME Ͱͷະདྷ