Working example of how to create timers in JavaScript?