js-stopwatch-timer
v1.0.0
Published
A simple stopwatch/timer module created with pure vanilla JavaScript without any external dependencies.
Downloads
6
Readme
js-stopwatch-timer
A simple stopwatch/timer module created with pure vanilla JavaScript without any external dependencies.
Usage
How to install and use in a project
- Download the repo
- Copy file src/timer.js in to your project directory
- Import the module and create an instance of Timer
import Timer from 'timer.js'
const timer = new Timer()
timer.start()
Methods
timer.start()
Starts counting upwards from 0.
timer.stop()
Stops the timer.
timer.reset()
Stops the timer and resets the time.
timer.countdown(seconds)
Starts a countdown of seconds depending on user input.
timer.lap()
Returns the time that has passed in an object.
timer.log()
Logs current time.
Versions
1.0.0
- 1.0.0 was released 2022-09-26