Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var timerId;
- stopTimer = function() {
- if(timerId)
- clearInterval(timerId);
- }
- startTimer = function() {
- timerId = setInterval(function() {
- //Do stuff
- console.log('stuff');
- }, 1000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement