woratana Posted December 23, 2013 Share Posted December 23, 2013 Hello, I would like to know how hard is it to make an accurate timer count down. For example, count down for 1 minute. I would also need to tell player the time left every second. I have heard that setTimeout may not be accurate. What is the best way to do this? Link to comment Share on other sites More sharing options...
Zeterain Posted December 23, 2013 Share Posted December 23, 2013 http://www.html5gamedevs.com/topic/1870-in-game-timer/?hl=timer Here is a discussion about a timer to count up with code included. With modification, it could accomplish what you want. There's also a built in countdown timer that will fire a callback on completion; Rich has the code for that in the above discussion. Arlefreak 1 Link to comment Share on other sites More sharing options...
woratana Posted December 25, 2013 Author Share Posted December 25, 2013 Thank you zeterain! I should have searched through the forum carefully Link to comment Share on other sites More sharing options...
Recommended Posts