<commit_before>const moment = require('moment');

function Timer(element) {
  this.element = element;
  this.secondsElapsed = 0;
}

Timer.prototype = {
  start: function() {
    var self = this;
    self.timerId = setInterval(function() {
      self.secondsElapsed++;
      self.displaySeconds();
    }, 1000);
  },

  stop: function() {
    var self = this;
    clearInterval(self.timerId);
  },

  displaySeconds: function() {
    var minutes = Math.floor(this.secondsElapsed / 60);
    var seconds = this.secondsElapsed % 60;
    this.element.text(String(minutes).padStart(2, "0") + ":" + String(seconds).padStart(2, "0"));
  }
};

module.exports = Timer;
<commit_msg>Add a reset method to the Timer class.<commit_after>const moment = require('moment');

function Timer(element) {
  this.element = element;
  this.secondsElapsed = 0;
}

Timer.prototype = {
  start: function() {
    var self = this;
    self.timerId = setInterval(function() {
      self.secondsElapsed++;
      self.displaySeconds();
    }, 1000);
  },

  stop: function() {
    var self = this;
    clearInterval(self.timerId);
  },

  displaySeconds: function() {
    var minutes = Math.floor(this.secondsElapsed / 60);
    var seconds = this.secondsElapsed % 60;
    this.element.text(String(minutes).padStart(2, "0") + ":" + String(seconds).padStart(2, "0"));
  },

  reset: function() {
    var self = this;
    clearInterval(self.timerId);
    self.secondsElapsed = 0;
    self.displaySeconds();
  }
};

module.exports = Timer;

{'fraction_non_alphanumeric': 0.15548172757475084, 'fraction_numerical': 0.017940199335548173, 'mean_word_length': 3.352601156069364, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, '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': '3344905', 'n_tokens_mistral': 513, 'n_tokens_neox': 481, 'n_words': 100}