reverse-timer-func
v1.0.1
Published
maybe you need it
Downloads
2
Readme
Some ifo
This function creates a little object by Closure. If you call it by function() you will start timer iteration, but you also have some functions of your object that can help you to control your timer: setStep(int) - set step of iteration (seconds) setRange(int) - set range of iteration (seconds) setReverse(bool) - set reverse iteration if you whant pause(bool) - make pause if you whant
Function requiers any value that will be valid for Date(). Optional you can pass: [step :int, range :int, reverse :bool]
try it
const timer = require('reverse-timer-func');
const test = timer(new Date);
setInterval(function () {
console.log(test())
}, 1000)