I ran into a problem where if you call reset() or stop() with multiple timers running it will actually stop all of them. :)
This is because the setTimeout ID returns just an incremented number. After the first timeout was stopped it would then stop the second occurrence of the timer. To solve this issue I added a prefix which adds a unique id to each timer instance.
I was also having issues with clicking "reset" borking the time of the other timers. Adding start_time, time, and elapsed as private variables seemed to fix this issue. I don't think it broke anything. ;)
I ran into a problem where if you call reset() or stop() with multiple timers running it will actually stop all of them. :)
This is because the setTimeout ID returns just an incremented number. After the first timeout was stopped it would then stop the second occurrence of the timer. To solve this issue I added a prefix which adds a unique id to each timer instance.
I was also having issues with clicking "reset" borking the time of the other timers. Adding start_time, time, and elapsed as private variables seemed to fix this issue. I don't think it broke anything. ;)