summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-03-03 09:56:35 +0300
committerAndrew Dolgov <[email protected]>2021-03-03 09:56:35 +0300
commitadf7189e9401ab486dbb2232b0b55030cbaecc81 (patch)
tree44bb495711aa61e2113783eb2db6e330f7ef16ff
parent3b67abb0ea44358b0740381a49cac28857153787 (diff)
show timing information in xhr.post/json
-rwxr-xr-xjs/common.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/js/common.js b/js/common.js
index 59231010e..194fdcd9d 100755
--- a/js/common.js
+++ b/js/common.js
@@ -154,7 +154,10 @@ String.prototype.stripTags = function() {
/* exported xhr */
const xhr = {
+ _ts: 0,
post: function(url, params = {}, complete = undefined, failed = undefined) {
+ this._ts = new Date().getTime();
+
console.log('xhr.post', '>>>', params);
return new Promise((resolve, reject) => {
@@ -171,7 +174,7 @@ const xhr = {
reject(error);
},
load: function(data, ioargs) {
- console.log('xhr.post', '<<<', ioargs.xhr);
+ console.log('xhr.post', '<<<', ioargs.xhr, (new Date().getTime() - xhr._ts) + " ms");
if (complete != undefined)
complete(data, ioargs.xhr);
@@ -197,7 +200,7 @@ const xhr = {
reject(e);
}
- console.log('xhr.json', '<<<', obj);
+ console.log('xhr.json', '<<<', obj, (new Date().getTime() - xhr._ts) + " ms");
if (obj && typeof App != "undefined")
if (!App.handleRpcJson(obj)) {