index.js
function _tock() {
    var config = this._config;
    var now = Date.now();
    var taskTime = now - this._started; // The time it took to finish the last task
    var delay = Math.max(0, config.delay - (taskTime)); // Delay until the next task is run

    if (config.limit) {
      this._count += 1;

      if (this._count >= config.limit) {
        this.stop();

        return;
      }
    }

    this._before = this._started;
    this._started = now + delay;

    this._timeout = setTimeout(this._tick, delay);
  }
function _tock() {
    var config = this._config;
    var now = Date.now();
    var taskTime = now - this._started; // The time it took to finish the last task
    var delay = Math.max(0, config.delay - (taskTime)); // Delay until the next task is run

    if (config.limit) {
      this._count += 1;

      if (this._count >= config.limit) {
        this.stop();

        return;
      }
    }

    this._before = this._started;
    this._started = now + delay;

    this._timeout = setTimeout(this._tick, delay);
  }
function _tock ( ) { var config = this . _config ; var now = Date . now ( ) ; var taskTime = now - this . _started ; // The time it took to finish the last task var delay = Math . max ( 0 , config . delay - ( taskTime ) ) ; // Delay until the next task is run if ( config . limit ) { this . _count += 1 ; if ( this . _count >= config . limit ) { this . stop ( ) ; return ; } } this . _before = this . _started ; this . _started = now + delay ; this . _timeout = setTimeout ( this . _tick , delay ) ; }
The second part of an iteration that is called after the task is done
The second part of an iteration that is called after the task is done