0.1.1 • Published 7 years ago
tick-of-clock v0.1.1
tick-of-clock
Stopwatch || Countdown ⏰
const toc = require('tick-of-clock');
let timer = toc();
timer.start(); //starts stopwatch
timer.start(2000); //starts countdown with 2000ms
timer.stop();
timer.reset(); // resets time to 0
timer.getTime(); // returns amount of ms that have passed
Events
start
stop
reset
How to use
timer.on('start', () => console.log("Let's Rock!"));