Better elapsed request time calculation

This commit is contained in:
liyasthomas
2019-10-12 23:13:37 +05:30
parent 39cbe8a858
commit 0fdb4197a1

View File

@@ -767,7 +767,7 @@
headers = headersObject; headers = headersObject;
try { try {
const startTime = new Date().getTime(); const startTime = Date.now();
const payload = await this.$axios({ const payload = await this.$axios({
method: this.method, method: this.method,
url: this.url + this.pathName + this.queryString, url: this.url + this.pathName + this.queryString,
@@ -776,8 +776,7 @@
data: requestBody ? requestBody.toString() : null data: requestBody ? requestBody.toString() : null
}); });
const endTime = new Date().getTime(); const duration = Date.now() - startTime;
const duration = endTime - startTime;
this.$toast.info(`Finished in ${duration}ms`, { this.$toast.info(`Finished in ${duration}ms`, {
icon: 'done' icon: 'done'
}); });