This timer is very simple and framework independent.
npm install @shhhplus/timer.js   
This timer is very simple and framework independent.
``sh`
npm install @shhhplus/timer.js --save
`javascript
import createTimer from '@shhhplus/timer.js';
const timer = createTimer({
interval: 1000,
onElapsed: () => {
console.log('onElapsed ...');
},
});
timer.start();
timer.stop();
`
`javascript
import createTimer from '@shhhplus/timer.js';
const timer = createTimer({
interval: 5000,
onElapsed: () => {
console.log('onElapsed ...');
return new Promise((resolve) => {
setTimeout(resolve, 500);
});
},
});
timer.start();
timer.stop();
``