0

Is posible print milliseconds too, into a clock? And that was overwrite every milliseconds

7th Nov 2016, 8:04 PM
kike3864
kike3864 - avatar
5 ответов
+ 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);
7th Nov 2016, 8:38 PM
Volts
Volts - avatar
0
Date.getTime() returns time in milliseconds. See this for example: http://www.w3schools.com/jsref/jsref_gettime.asp
7th Nov 2016, 8:25 PM
Sašo Piskar
Sašo Piskar - avatar
0
I am not sure about reloading it every millisecond. That means 1000 fps. Your CPU will get on fire :)
7th Nov 2016, 9:48 PM
Sašo Piskar
Sašo Piskar - avatar
0
Ok. Thanks
8th Nov 2016, 12:09 PM
kike3864
kike3864 - avatar
0
Ok. Thanks
8th Nov 2016, 12:09 PM
kike3864
kike3864 - avatar