Stopwatch
React.js
medium
30 mins
Build a simple stopwatch with Start, Stop, and Reset functionality. The stopwatch should display elapsed time in seconds and update every second while running.
Requirements
- Display a timer starting at
0. - Include three buttons: Start, Stop, and Reset.
- On clicking Start, the timer should begin incrementing every second.
- Stop should pause the timer.
- Reset should stop the timer and reset it back to
0. - Ensure the timer doesn’t increment multiple times if Start is clicked repeatedly.
Constraints & Edge Cases
- Timer should not increment if already running and Start is clicked again.
- After Reset, the timer should show
0and stop ticking. - Stop should not reset the time.
- Memory leaks must be avoided when using intervals.
Reference UI

Preview what you need to build
Companies:
uber
ola
Solve Similar questions 🔥
Want to upskill? Explore our courses!
Namaste DSA
Master DSA from scratch with numerous problems, and expert guidance.
Namaste React
Wanna dive deep into React and become Frontend Expert? Learn with me now!
Namaste Frontend System Design
The most comprehensive and detailed course for frontend system design.
Namaste Node.js
Wanna dive deep into Node.js? Enroll into `Namaste Node.js` now!
