0
Is posible print milliseconds too, into a clock? And that was overwrite every milliseconds
5 Réponses
+ 2
You can with the getMilliseconds() method !
You will probably need to use the setInterval() method to reload it every milliseconds. I don't know if it is a good idea but you can try this:
var millis = yourDateObject.getMilliseconds();
setInterval(function(){
millis++;
if(millis == 1000)
millis = 0;
//here you print the millis var.
}, 1);
0
Date.getTime() returns time in milliseconds. See this for example: http://www.w3schools.com/jsref/jsref_gettime.asp
0
I am not sure about reloading it every millisecond. That means 1000 fps. Your CPU will get on fire :)
0
Ok. Thanks
0
Ok. Thanks