stopwatsch
v1.4.3
Published
[](https://badge.fury.io/js/stopwatsch)
Downloads
3
Readme
Stopwatsch
A simple light weight JavaScript Stopwatch
Installation
To install and set up the library, run:
$ npm install stopwatschGetting Started
import stopwatsh from 'stopwatsch';
stopwatsh.start()
setTimeout(() => console.log(stopwatsh.time), 1000) // ≈ 1000methods
#start()
stopwatsh.start()Starts the stopwatch
#stop()
stopwatsh.stop()
stopwatsh.pause()Stops the stopwatch
#restart()
stopwatsh.restart()Restarts the stopwatch
properties
#milliseconds
stopwatsh.time
stopwatsh.ms
stopwatsh.millisecondsThe elapsed time in milliseconds
#seconds
stopwatsh.s
stopwatsh.sec
stopwatsh.secondsThe elapsed time in seconds
#minutes
stopwatsh.m
stopwatsh.min
stopwatsh.minutesThe elapsed time in minutes
#hours
stopwatsh.h
stopwatsh.hoursThe elapsed time in hours
