Show load time. Make it faster. Make it easier to instrument.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3747 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2022-01-09 20:36:15 +00:00
parent c28d4d9378
commit 32c7fcbbfa
4 changed files with 29 additions and 35 deletions

View File

@@ -19,8 +19,10 @@ var g_data = {
selected: null,
edit_profile_name: null,
edit_profile_description: null,
load_time: null,
};
var g_load_start = new Date();
var g_data_initial = JSON.parse(JSON.stringify(g_data));
var g_message_queue = [];
var g_process_pending = false;
@@ -106,11 +108,13 @@ function processMessages() {
g_data.votes[link][content.vote.expression].push({author: vote.author, value: content.vote.value});
});
} else if (key == 'clear') {
g_load_start = new Date();
g_data.loading = true;
Object.keys(g_data_initial).forEach(function(key) {
Vue.set(g_data, key, JSON.parse(JSON.stringify(g_data_initial[key])));
});
} else if (key == 'ready') {
g_data.load_time = (new Date() - g_load_start) / 1000;
g_data.loading = false;
} else if (key == 'unread') {
g_data.unread += event.data.unread;