timercore ⏳
Robust, accurate, and precise timer library for Node.js
Install
npm
npm install --save timercore
yarn
yarn add timercore
Example
const Timer = // The timer expects a non-negative integer argumentconst seconds = 10const timer = seconds // A timer initialized with zero will not emit any events and starting or// stopping the timer will have no effect timer timer // Start the timertimerstart // Start it again if you like; the start method is idempotenttimerstart // Stop the timertimer // Stop it again if you like; the stop method is also idempotenttimer // Resume the timer if it was previously stopped and has not yet finishedtimerstart // Starting or stopping a timer that has finished will have no effect // When you are done with a timer and need another, just create a new oneconst anotherTimer = 60