DEV Community

loading...

Discussion on: Create a Stopwatch in JavaScript

Collapse
mahmoudibnsamy profile image
Mahmoud Ibn Samy

It's a good implementation but I think by the time it won't represent the real-time as the 'setTimeout()' function won't run after an exact second, there will be some small lag.
I think it will be better if you made use of the Date object.

Collapse
gspteck profile image
GSPTeck Author

That's a great idea, but at the moment I don't know how to do that.
If I ever learn how to do it, I might update the post.