We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I would like to reset the timer to 00:00:00 without restarting it until timer.start(); is called again. Is that possible?
00:00:00
timer.start();
Or maybe another way to ask, is how can I destroy the current timer instance and create a new one with an click event?
The text was updated successfully, but these errors were encountered:
Hi!
The "stop" function sets the counters to 0, so you can listen to the 'stopped' event and then write the value. For example:
var { Timer } = require("easytimer.js"); var myTimer = new Timer(); myTimer.start(); myTimer.on('stopped', () => { console.log(myTimer.getTimeValues().toString()); }); myTimer.on('secondsUpdated', () => { console.log(myTimer.getTimeValues().toString()); if (myTimer.getTimeValues().seconds >= 3) { myTimer.stop(); } });
Live example: https://runkit.com/albert-gonzalez/5c264bf92eac850012ca0e09
After that, you can start again the timer calling the "start" function.
Best Regards!
Sorry, something went wrong.
No branches or pull requests
I would like to reset the timer to
00:00:00
without restarting it untiltimer.start();
is called again. Is that possible?Or maybe another way to ask, is how can I destroy the current timer instance and create a new one with an click event?
The text was updated successfully, but these errors were encountered: