Limit decimal places length of response time in ms

This commit is contained in:
Peter Stockings
2024-03-29 19:07:17 +11:00
parent db191d7cf5
commit e92a1ad69d

View File

@@ -12,7 +12,7 @@ show_refresh=False, show_link=False, show_edit_form=True, show_client=True, show
<script>
function formatTime(milliseconds) {
if (milliseconds < 1000) {
return `${milliseconds} ms`; // Display milliseconds directly if less than 1 second
return `${milliseconds.toFixed(2)} ms`; // Display milliseconds directly if less than 1 second
}
const seconds = milliseconds / 1000;