diff --git a/js/pis.js b/js/pis.js index f39db0a..f0c3ba5 100644 --- a/js/pis.js +++ b/js/pis.js @@ -7,7 +7,9 @@ async function findByOrigDest() { const formData = await fetchOrigDest() log(`findByOrigDest: Searching for PIS Code for ${JSON.stringify(formData)}`) const endpoint = `pis/origdest/${formData.origin}/${formData.destination}` + console.time('findByOrigDest-GET') const json = await getApi(endpoint, auth = true) + console.timeEnd('findByOrigDest-GET') if (json == false) { await displayNoData() } else if (json == 401) { @@ -30,6 +32,7 @@ async function insertData(json) { // Receives the JSON Respose ([{},{}]) containing one or more possible // PIS codes. Display the code and the stops with a method of scrolling between them. // Maybe as a table or a carousel? + console.time('insertData') const div = document.getElementById('result-box') let tableData = ` @@ -45,6 +48,7 @@ async function insertData(json) { tableData += '
' div.insertAdjacentHTML('beforeend', tableData) document.getElementById('result-count').textContent = results.toString() + console.timeEnd('insertData') } async function displayNoData() { diff --git a/pis.html b/pis.html index a42fddd..91217a9 100644 --- a/pis.html +++ b/pis.html @@ -57,7 +57,7 @@

- + @@ -67,7 +67,7 @@ and destination individually with a previous and next arrow. --> - +