From 9b41c4efa8f2377ef6c614072d7fc32ef4ae8587 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 14 Oct 2010 09:31:17 +1100 Subject: [PATCH] control rollperiod and show load time --- live/graphs.js | 10 +++++++--- live/index.html | 3 +++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/live/graphs.js b/live/graphs.js index d2317e0..1951f1b 100644 --- a/live/graphs.js +++ b/live/graphs.js @@ -109,14 +109,18 @@ function loading(busy) { if (busy) { loading_counter++; if (loading_counter == 1) { + started_loading=new Date(); hide_div("loading", false); } } else { if (loading_counter > 0) { loading_counter--; - } - if (loading_counter == 0) { - hide_div("loading", true); + if (loading_counter == 0) { + hide_div("loading", true); + var d = new Date(); + var load_time = d.getTime() - started_loading.getTime(); + writeDebug("Loading took: " + (load_time/1000)); + } } } } diff --git a/live/index.html b/live/index.html index 59e7ee5..4b7b7e4 100755 --- a/live/index.html +++ b/live/index.html @@ -66,6 +66,9 @@ if (hashvars['date'] != undefined) { } else { pvdate = canberraDate(); } +if (hashvars['roll'] != undefined) { + defaultAttrs.rollPeriod = (+hashvars['roll']); +} serialnums = [ 2001551093, 2001511859, 2001551109, 2001559615, 2001512099, 2001511912 ]; CSV_directory = "../CSV/"; setup_datepicker(); -- 2.34.1