Add time counters for total time and fetch time.
This commit is contained in:
parent
8e2185d185
commit
3a24d8ef2e
@ -1,7 +1,9 @@
|
|||||||
/* Fetch Functions */
|
/* Fetch Functions */
|
||||||
async function publicLdb(stn) {
|
async function publicLdb(stn) {
|
||||||
var url = `${window.location.origin}/api/v1/ldb/${stn}`;
|
var url = `${window.location.origin}/api/v1/ldb/${stn}`;
|
||||||
|
console.time("Time: Fetch LDB Data")
|
||||||
var resp = await fetch(url);
|
var resp = await fetch(url);
|
||||||
|
console.timeEnd("Time: Fetch LDB Data")
|
||||||
return await resp.json();
|
return await resp.json();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ init()
|
|||||||
|
|
||||||
/* Init function */
|
/* Init function */
|
||||||
async function init() {
|
async function init() {
|
||||||
console.time("Loading Time")
|
console.time("Time: Init to Complete")
|
||||||
setLoadingDesc(`Loading\nservices`)
|
setLoadingDesc(`Loading\nservices`)
|
||||||
var stn = await getQuery("stn");
|
var stn = await getQuery("stn");
|
||||||
setLoadingDesc(`Loading\n${stn.toUpperCase()}`)
|
setLoadingDesc(`Loading\n${stn.toUpperCase()}`)
|
||||||
@ -82,7 +82,7 @@ async function buildPage(data) {
|
|||||||
setLoadingDesc('Loading\nBusses')
|
setLoadingDesc('Loading\nBusses')
|
||||||
displayBus(await makeArray(data.GetStationBoardResult.busServices.service))
|
displayBus(await makeArray(data.GetStationBoardResult.busServices.service))
|
||||||
}
|
}
|
||||||
console.timeEnd("Loading Time")
|
console.timeEnd("Time: Init to Complete")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user