1.1.4 • Published 4 years ago

@nanomatic/timer v1.1.4

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Status License


📝 Table of Contents

🏁 Getting Started

Installing

npm i @nanomatic/timer

Using

Example code below:

import { Timer } from '@nanomatic/timer';

const timer = new Timer;

// Time to countdown in s
timer.time = 5;

// tslint:disable-next-line: no-console
timer.start();

// tslint:disable-next-line: no-console
setInterval(() => console.log(`Elapsed time: ${timer.elapsedTime.toFixed(3)}s / ${timer.time.toFixed(3)}s   Reamining time: ${timer.remainingTime.toFixed(3)}s / 0s   ${timer.done ? 'Done' : ''}`), 100);

// Simulation
setTimeout(() => timer.pause(), 2000);
setTimeout(() => timer.resume(), 5000);
setTimeout(() => timer.reset(false), 10000);
setTimeout(() => {
    timer.time = 0;
    timer.start();
}, 13000);

⛏️ Built With

✍️ Authors

🎉 Acknowledgments

  • Special thanks for Sebastian for working together and giving ideas 😉
1.1.4

4 years ago

1.1.3

4 years ago

1.1.1

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago