<commit_before>import {useFakeTimers} from 'sinon';


export var tick = function(tickParams: {
  before: Function,
  after: Function,
  delay: number,
}): void {
  let time = useFakeTimers();
  let beforeResult = tickParams.before();

  time.tick(tickParams.delay);
  time.restore();

  process.nextTick(function(): void {
    tickParams.after(beforeResult);
  });
};

export var now = function(): number {
  return Number(new Date).valueOf();
};<commit_msg>fix for node 6 tests<commit_after>import {useFakeTimers} from 'sinon';


export var tick = function(tickParams: {
  before: Function,
  after: Function,
  delay: number,
}): void {
  let time = useFakeTimers();
  let beforeResult = tickParams.before();

  time.tick(tickParams.delay);
  time.restore();

  setTimeout(
    function(): void {
      tickParams.after(beforeResult);
    },
    0
  );
};

export var now = function(): number {
  return Number(new Date).valueOf();
};
{'fraction_non_alphanumeric': 0.1452991452991453, 'fraction_numerical': 0.002136752136752137, 'mean_word_length': 4.120218579234972, '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': '766983', 'n_tokens_mistral': 299, 'n_tokens_neox': 292, 'n_words': 74}