Add time counters for total time and fetch time.

This commit is contained in:
Fred Boniface 2023-03-10 21:52:25 +00:00
parent 8e2185d185
commit 3a24d8ef2e
2 changed files with 4 additions and 2 deletions

View File

@ -1,7 +1,9 @@
/* Fetch Functions */
async function publicLdb(stn) {
var url = `${window.location.origin}/api/v1/ldb/${stn}`;
console.time("Time: Fetch LDB Data")
var resp = await fetch(url);
console.timeEnd("Time: Fetch LDB Data")
return await resp.json();
}

View File

@ -3,7 +3,7 @@ init()
/* Init function */
async function init() {
console.time("Loading Time")
console.time("Time: Init to Complete")
setLoadingDesc(`Loading\nservices`)
var stn = await getQuery("stn");
setLoadingDesc(`Loading\n${stn.toUpperCase()}`)
@ -82,7 +82,7 @@ async function buildPage(data) {
setLoadingDesc('Loading\nBusses')
displayBus(await makeArray(data.GetStationBoardResult.busServices.service))
}
console.timeEnd("Loading Time")
console.timeEnd("Time: Init to Complete")
}