Can I see if a timer is still running?

What I do is:

var timer = null;

if (timer != null) {
  window.clearTimeout(timer); 
  timer = null;
}
else {
  timer = window.setTimeout(yourFunction, 0);
}

Leave a Comment