swiss-watch
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

swiss-watch

Basic timer that uses diffs in timestamps instead of relying on setTimeout firing at exact times. Can either work like a regular stop watch, or a count down.

countdown

var timer = new SwissWatch();

timer
.on('start', () => { // })
.on('finish', () => { // will be called after 60 seconds })
.on('stop', () => { // })
.on('tick', (status: ISwissWatchStatus) => {

}).start(60);

timer

var timer = new SwissWatch();

timer
.on('start', () => { // })
.on('finish', () => { // })
.on('stop', () => { // })
.on('tick', (status: ISwissWatchStatus) => {

}).start();

setTimeout(() => {
    timer.stop();
}, 5000);

Dependencies (0)

    Dev Dependencies (11)

    Package Sidebar

    Install

    npm i swiss-watch

    Weekly Downloads

    0

    Version

    1.0.1

    License

    GPL-3.0

    Unpacked Size

    51.7 kB

    Total Files

    9

    Last publish

    Collaborators

    • chris1234p