title: Countdown Timer to Add extra 2 minutes
body: <p>I have created a countdown timer and am trying to add 2 minutes into the existing timer to extend the timer.</p>
  
  <p>My Code</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function CountDownTimer(duration, granularity) {
    this.duration = duration;
    this.granularity = granularity || 1000;
    this.tickFtns = [];
    this.running = false;
  }
  
  CountDownTimer.prototype.start = function() {
    if (this.running) {
      return;
    }
    this.running = true;
    var start = Date.now(),
      that = this,
      diff, obj;
  
    (function timer() {
      diff = that.duration - (((Date.now() - start) / 1000) | 0);
  
      if (diff &gt; 0) {
        setTimeout(timer, that.granularity);
      } else {
        diff = 0;
        that.running = false;
      }
  
      obj = CountDownTimer.parse(diff);
      that.tickFtns.forEach(function(ftn) {
        ftn.call(this, obj.minutes, obj.seconds);
      }, that);
    }());
  };
  
  CountDownTimer.prototype.onTick = function(ftn) {
    if (typeof ftn === 'function') {
      this.tickFtns.push(ftn);
    }
    return this;
  };
  
  CountDownTimer.prototype.expired = function() {
    return !this.running;
  };
  
  CountDownTimer.parse = function(seconds) {
    return {
      'minutes': (seconds / 60) | 0,
      'seconds': (seconds % 60) | 0
    };
  };
  
  $(document).ready(function() {
    var counter = 0;
  
    var display = document.querySelector('#time'),
      //timer = new CountDownTimer(600);
      timer = new CountDownTimer(125); // for debug
    timer.onTick(format).onTick(restart).start();
  
    function restart() {
      if (this.expired()) {
        alert("Expired");
      }
    }
  
    function format(minutes, seconds) {
      minutes = minutes &lt; 10 ? "0" + minutes : minutes;
      seconds = seconds &lt; 10 ? "0" + seconds : seconds;
      display.textContent = minutes + ':' + seconds;
      if (minutes &lt; 2) {
        if (counter == 0) {
          alert("Extending Time");
          counter++;
        }
      }
    }
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;span id="time"&gt;&lt;/span&gt; minutes</code></pre>
  </div>
  </div>
  </p>
  
  <p>I managed to trigger an event that after 2 minutes will show an alert that the time will be extended, but so far, I can't think of any method or functions I can use to add the extra time. Is there any way I can do this?</p>