<commit_before>function ProgressionController() {
    var counter;
    var request;
    var canvas;

    this.draw = function() {
      var ctx = canvas.getContext('2d');

      document.getElementById('counter').innerHTML = Math.floor(counter);

      ctx.clearRect(0, 0, canvas.width, canvas.height);

      ctx.beginPath();
      ctx.lineWidth = "1";
      ctx.strokeStyle = "black";
      ctx.moveTo(0,0);
      var y = 200;
      var w = (canvas.width / counter);
      for (var i = 1; i <= counter; i++) {
          ctx.lineTo(w * i, y);
          y = (y == 200 ? 0 : 200);
      }
      ctx.lineTo(canvas.width,0);
      ctx.stroke();

      counter += 0.5;
    };

    this.start = function(c) {
      canvas = c;
      counter = 1;
      this.draw();
      var $this = this;
      var animFrame = function(time) {
          $this.draw();
          request = requestAnimationFrame(animFrame);
      };
      request = requestAnimationFrame(animFrame);
    };
}
<commit_msg>Use time parameter in requestAnimationFrame.<commit_after>function ProgressionController() {
    var counter;
    var request;
    var canvas;

    this.draw = function(timeElapsed) {
      var ctx = canvas.getContext('2d');

      var counter_elem = document.getElementById('counter');
      if (counter_elem) {
          counter_elem.innerHTML = Math.floor(counter);
              // + "<br/>" + timeElapsed;
      }

      ctx.clearRect(0, 0, canvas.width, canvas.height);

      ctx.beginPath();
      ctx.lineWidth = "1";
      ctx.strokeStyle = "black";
      ctx.moveTo(0,0);
      var y = 200;
      var w = (canvas.width / counter);
      for (var i = 1; i <= counter; i++) {
          ctx.lineTo(w * i, y);
          y = (y == 200 ? 0 : 200);
      }
      ctx.lineTo(canvas.width,0);
      ctx.stroke();

      counter += timeElapsed / 45.0;
    };

    this.start = function(c) {
      canvas = c;
      counter = 1;
      var $this = this;
      var lastTime = null;
      var animFrame = function(time) {
          var timeElapsed = lastTime == null ? 0 : time - lastTime;
          lastTime = time;
          $this.draw(timeElapsed);
          requestAnimationFrame(animFrame);
      };
      requestAnimationFrame(animFrame);
    };
}

{'fraction_non_alphanumeric': 0.14202508960573476, 'fraction_numerical': 0.01971326164874552, 'mean_word_length': 2.005383580080754, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5801084', 'n_tokens_mistral': 727, 'n_tokens_neox': 686, 'n_words': 159}