Here is the code:
Change number depending on how fast you want the colors to change
// var myVar = setInterval(function(){ myTimer() }, 1000);
function myTimer() {
var d = new Date();
var t = d.toLocaleTimeString();
document.getElementById("demo").innerHTML = t;
}
// end of loop
A script on this page starts this clock: