> ## Content Index
> Fetch the complete content index at: https://reactpractice.dev/llms.txt
> Use this file to discover other available public pages before exploring further.

# Create a timer that can be started and stopped
- URL: https://reactpractice.dev/exercise/create-a-timer-that-can-be-started-and-stopped/
- Published: 2022-10-26T17:22:59.000Z
- Updated: 2026-06-01T01:58:05.000Z
- Author: Corina Udrescu
- Tags: Working with setInterval, #corina-2, Exercises, Working with dates, #Import 2026-06-09 12:07

Create a 5 minute countdown timer that can be started and stopped.

1. When the page is first loaded, the counter displays 5 minutes (i.e. `5:00`)
2. When the user clicks "Start", the counter starts counting down.
3. When the user clicks "Stop", the timer should stop elapsing time.
4. When the user clicks "Reset", the timer should be reset to 5 minutes again

To get started, you can just [spin off a new project using Vite](https://vite.dev/guide/?ref=reactpractice.dev#scaffolding-your-first-vite-project).

**What you will practice:**

- working with `Date` objects
- formatting dates
- `useState` hook
- using `setInterval` in React
- using the "updater" version of `useState` setter function

💡

Ready to check your work?  
[Become a member](https://reactpractice.dev/become-a-member/) and get access to the [official solution](https://reactpractice.dev/solution/tutorial-create-a-timer-that-can-be-started-and-stopped/) and the comments section for feedback and discussion.