<commit_before>import pad from './pad';

export default class TimeSpan {

  constructor(millisec) {

    this.millisec = millisec || 0;

    let sec = millisec / 1000;

    this.days = ~~(sec / 86400);
    // After deducting the days calculate the number of hours left
    this.hours = ~~((sec - (this.days * 86400)) / 3600);
    // After days and hours , how many minutes are left
    this.mins = ~~((sec - (this.days * 86400) - (this.hours * 3600)) / 60);
    // Finally how many seconds left after removing days, hours and minutes.
    this.sec = ~~((sec - (this.days * 86400) - (this.hours * 3600) - (this.mins * 60))) + 1;
    // Set total sec
    this.totalSec = ~~sec + 1;
  }

  get totalDays() {
    return this.days;
  }

  get totalHours() {
    return ~~(this.totalsec / 3600);
  }

  get totalMins() {
    return ~~(this.totalsec / 60);
  }

  toString() {
    let timer = '';

    if (this.days > 0)
      timer += `${pad(this.days)}:`;

    timer += `${pad(this.hours)}:`;
    timer += `${pad(this.mins)}:${pad(this.sec)}`;

    return timer;
  }
}<commit_msg>timespan<commit_after>import pad from './pad';

export default class TimeSpan {

  constructor(millisec) {

    this.millisec = millisec || 0;

    let sec = millisec / 1000;

    this.days = ~~(sec / 86400);
    // After deducting the days calculate the number of hours left
    this.hours = ~~((sec - (this.days * 86400)) / 3600);
    // After days and hours , how many minutes are left
    this.mins = ~~((sec - (this.days * 86400) - (this.hours * 3600)) / 60);
    // Finally how many seconds left after removing days, hours and minutes.
    this.sec = ~~((sec - (this.days * 86400) - (this.hours * 3600) - (this.mins * 60))) + 1;
    // Set total sec
    this.totalSec = ~~sec + 1;
  }

  get totalDays() {
    return this.days;
  }

  get totalHours() {
    return ~~(this.totalSec / 3600);
  }

  get totalMins() {
    return ~~(this.totalSec / 60);
  }

  toString() {
    let clock = '';

    if (this.days > 0)
      clock += `${pad(this.days)}:`;

    clock += `${pad(this.hours)}:${pad(this.mins)}:${pad(this.sec)}`;

    return clock;
  }
}
{'fraction_non_alphanumeric': 0.1762218045112782, 'fraction_numerical': 0.046992481203007516, 'mean_word_length': 2.456168831168831, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4391293', 'n_tokens_mistral': 853, 'n_tokens_neox': 758, 'n_words': 206}