<commit_before>package thx.benchmark.measure;

class Stopwatch {
  public static function go() {
    var inst = new Stopwatch();
    inst.start();
    return inst;
  }

/**
Elapsed time in milliseconds.
*/
  public var elapsed(get, null) : Float;

/**
Elapsed time in seconds.
*/
  public var elapsedSeconds(get, null) : Float;

  public var isRunning(default, null) : Bool;

  var _elapsed : Float;
  var startTime : Float;
  var endTime : Null<Float>;
  var timer : Void -> Float;
  public function new(?timer : Void -> Float) {
    this.timer = null == timer ? thx.Timer.time : timer;
    _elapsed = 0;
    isRunning = false;
  }

  public function start() {
    if(isRunning) return;
    isRunning = true;
    startTime = timer();
  }

  public function stop() {
    if(!isRunning) return;
    endTime = timer();
    isRunning = false;
    _elapsed += endTime - startTime;
  }

  public function reset() {
    _elapsed = 0;
  }

  public function restart() {
    reset();
    start();
  }

  function get_elapsed()
    return elapsed + (isRunning ? timer() - startTime : 0);


  function get_elapsedSeconds()
    return elapsed / 1000;<commit_msg>fixed error in Stopwatch.get_elapsed<commit_after>package thx.benchmark.measure;

class Stopwatch {
  public static function go() {
    var inst = new Stopwatch();
    inst.start();
    return inst;
  }

/**
Elapsed time in milliseconds.
*/
  public var elapsed(get, null) : Float;

/**
Elapsed time in seconds.
*/
  public var elapsedSeconds(get, null) : Float;

  public var isRunning(default, null) : Bool;

  var _elapsed : Float;
  var startTime : Float;
  var endTime : Null<Float>;
  var timer : Void -> Float;
  public function new(?timer : Void -> Float) {
    this.timer = null == timer ? thx.Timer.time : timer;
    _elapsed = 0;
    isRunning = false;
  }

  public function start() {
    if(isRunning) return;
    isRunning = true;
    startTime = timer();
  }

  public function stop() {
    if(!isRunning) return;
    endTime = timer();
    isRunning = false;
    _elapsed += endTime - startTime;
  }

  public function reset() {
    _elapsed = 0;
  }

  public function restart() {
    reset();
    start();
  }

  function get_elapsed()
    return _elapsed + (isRunning ? timer() - startTime : 0);


  function get_elapsedSeconds()
    return elapsed / 1000;
{'fraction_non_alphanumeric': 0.12252794496990542, 'fraction_numerical': 0.0060189165950128975, 'mean_word_length': 2.8848080133555927, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '6330389', 'n_tokens_mistral': 781, 'n_tokens_neox': 730, 'n_words': 220}