• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Most efficient timer function in javascript

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

MrX

Registered
Joined
Oct 22, 2001
Been playing with this for a while now - like to see if anyone can come up with an efficient timer function in javascript. It can be implemented in only a few lines but timing is so poorly integrated in js that I would like to get a few other peoples ideas. Please note that I regard the setInterval and setTimeout as inferior to the needs of many projects. I use a couple of kludges at the moment but I'm trying to hone down my techniques to a few finely tuned pieces of code and a timer is vital to many projects.
 
Last edited: