MilliClock (High Precision) Script

Experience time in high definition. MilliClock provides a real-time digital display of hours, minutes, seconds, and rapidly updating milliseconds for a truly high-precision interface.

High-Speed Demo

System Precision Time
00:00:00.000

Copy the Script

<div id="milliclock"></div>

<script>
function updateMilliClock() {
    var now = new Date();
    var h = now.getHours().toString().padStart(2, '0');
    var m = now.getMinutes().toString().padStart(2, '0');
    var s = now.getSeconds().toString().padStart(2, '0');
    var ms = now.getMilliseconds().toString().padStart(3, '0');

    document.getElementById("milliclock").innerHTML = 
        h + ":" + m + ":" + s + "." + ms;

    requestAnimationFrame(updateMilliClock);
}
updateMilliClock();
</script>

FAQ

requestAnimationFrame syncs with your monitor's refresh rate (usually 60fps), making the fast-moving milliseconds look much smoother and reducing battery drain compared to a high-speed interval.

Yes. Simply delete the ms variable and the corresponding concatenation in the final display line.