Say I have this code for a simple timer:
var a = document.getElementById("a")
var start = Date.now()
window.onload = function() {
setInterval(()=>{
a.innerHTML = ((Date.now() - start)/1000).toFixed(3)
}, 1)
}
<p id="a">0.000</p>
.033, .067, .100, .167,
etc. I cannot modify the setInterval
just to do this because of how inaccurate it is, so how can I round what the current time is so that the decimal ends in a valid value?I know this is terribly worded, I apologize