Update Readme.md (#985)

Change ```new Date``` to ```Date.now```
master
song 2017-05-17 10:38:00 +08:00 committed by Yiyu He
parent d394724200
commit bfce5806c2
1 changed files with 2 additions and 2 deletions

View File

@ -56,9 +56,9 @@ Here is an example of logger middleware with each of the different functions:
```js ```js
app.use(async (ctx, next) => { app.use(async (ctx, next) => {
const start = new Date(); const start = Date.now();
await next(); await next();
const ms = new Date() - start; const ms = Date.now() - start;
console.log(`${ctx.method} ${ctx.url} - ${ms}ms`); console.log(`${ctx.method} ${ctx.url} - ${ms}ms`);
}); });
``` ```