Timing functions in JavaScript can be used in many different modes of operation and functions. Mostly they are used for checks, timeouts, and simple timers, but they can be used for more complex processes. One of a better examples where time functions may be applied in a more complex environment is a stop-watch. The example below shows how to code a simple stop-watch entirely with JavaScript (with CSS and HTML).

The example below includes a stop-watch START and STOP buttons, and also a ZERO button that may be used to reset the stop-watch. Everything is rounded up with a nice display showing minutes, seconds and miliseconds. 

Example with a simple stopwatch made in JavaScript


›› go to examples ››