forked from cory/tildefriends
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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user