From 0fdb4197a180c30515539a22ebf080616c3bfd60 Mon Sep 17 00:00:00 2001 From: liyasthomas Date: Sat, 12 Oct 2019 23:13:37 +0530 Subject: [PATCH] :zap: Better elapsed request time calculation --- pages/index.vue | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pages/index.vue b/pages/index.vue index c62788f84..f5e3a0b5c 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -767,7 +767,7 @@ headers = headersObject; try { - const startTime = new Date().getTime(); + const startTime = Date.now(); const payload = await this.$axios({ method: this.method, url: this.url + this.pathName + this.queryString, @@ -776,8 +776,7 @@ data: requestBody ? requestBody.toString() : null }); - const endTime = new Date().getTime(); - const duration = endTime - startTime; + const duration = Date.now() - startTime; this.$toast.info(`Finished in ${duration}ms`, { icon: 'done' });