From 53ce8686c250b270314085b26a0c00e09bc50979 Mon Sep 17 00:00:00 2001 From: mk-pmb Date: Thu, 8 Apr 2021 01:04:42 +0200 Subject: [PATCH] [test][minor] avoid creating temporary Date objects --- test/testing-code.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testing-code.js b/test/testing-code.js index 0ed15a0..2dce9ba 100644 --- a/test/testing-code.js +++ b/test/testing-code.js @@ -3,9 +3,9 @@ export async function p() { } function * responseTime (next) { - let start = new Date() + let start = Date.now() yield next - var ms = new Date() - start + var ms = Date.now() - start this.set('X-Response-Time', ms + 'ms') }