all templates
Web Basics

Stopwatch

Start, stop, lap — accurate timing that doesn't drift.

A stopwatch with lap times that stays accurate by measuring elapsed time instead of counting ticks — the mistake most first attempts make. A tidy lesson in doing time right.

What's inside

  • Start / stop / reset and lap splits
  • Accurate timing from performance.now(), not tick counting
  • Clean mm:ss.cs formatting
  • Lap list rendered from an array
  • Light & dark mode, no dependencies

Quickstart

$ git clone https://github.com/devai-io/devai_boilerplates.git$ cd devai_boilerplates/stopwatch$ open index.html   # or just double-click the file

Browse the code

The full source, exactly as it ships in the repo.

loading…
Download .zip
loading tree…

about this tutorial

A devai.io starter tutorial — the right way to measure time in the browser.