{literal}
<p id=”loadTime” style=”font-size: 16px; font-weight: bold; text-align: center;color: blue;”>Calculating…</p>
<script>
window.onload = function () {
let performanceData = window.performance.timing;
let loadTimeMs = performanceData.loadEventEnd – performanceData.navigationStart;
// Convert to seconds and milliseconds
let seconds = Math.floor(loadTimeMs / 1000);
let milliseconds = loadTimeMs % 1000;
// Format the output in a more readable way
let readableTime = seconds > 0
? `${seconds} second${seconds !== 1 ? ‘s’ : ”} and ${milliseconds} milliseconds`
: `${milliseconds} milliseconds`;
document.getElementById(“loadTime”).textContent = `Page Load Time: ${readableTime}.`;
};
</script>
{/literal}