<commit_before>import time


def _fmt_time(t):
  return '%dh %dmin %ds %dms' % (t // (60 * 60 * 1000), t // (60 * 1000), t // 1000, t % 1000)


class Timer:
  def __init__(self):
    self.last  = 0
    self.total = 0

  def start(self):
    self.last = int(round(time.time() * 1000))

  def lap(self):
    t = int(round(time.time() * 1000))
    d = t - self.last
    self.last = t
    self.total += d
    return _fmt_time(d), _fmt_time(self.total)<commit_msg>Fix elapsed time formatting<commit_after>import time


def _fmt_time(t):
  hours   = t // (60 * 60 * 1000)
  mins    = (t % (60 * 60 * 1000)) // (60 * 1000)
  secs    = (t % 60 * 1000) // 1000
  millis  = t % 1000
  return '%dh %dmin %ds %dms' % (hours, mins, secs, millis)


class Timer:
  def __init__(self):
    self.last  = 0
    self.total = 0

  def start(self):
    self.last = int(round(time.time() * 1000))

  def lap(self):
    t = int(round(time.time() * 1000))
    d = t - self.last
    self.last = t
    self.total += d
    return _fmt_time(d), _fmt_time(self.total)
{'fraction_non_alphanumeric': 0.16666666666666666, 'fraction_numerical': 0.07514450867052024, 'mean_word_length': 2.4749163879598663, 'pattern_counts': {'":': 0, '<': 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': '1631275', 'n_tokens_mistral': 489, 'n_tokens_neox': 400, 'n_words': 111}