hr-watch
v1.0.1
Published
A high-resoultion stopwatch for Node.
Downloads
12
Maintainers
Readme
hr-watch
A high-resoultion stopwatch for Node.
v1.0.1
API
start
starts timer
stop([unit])
stops timer
returns elapsed time
lap
marks a lap, starts a new lap timer
returns previous lap time (unit)
read([unit])
gets current timer
- when running laps, returns an array of laps
- when not running laps, returns the current elapsed time
clear
clears out timer
reset
stops timer and clears
unit(unit)
sets returned unit (ns, ms, s), by default this is ns
TODO
- multiple named timers
- improve README
kickstarted by npm-boom