<commit_before>import { benchmark } from './benchmark';
import { Coroutine } from '..';

describe('Benchmark:', function () {
  this.timeout(10 * 1e3);

  describe('Coroutine', function () {
    it('new', function (done) {
      benchmark('Coroutine new', () => new Coroutine(function* () { return undefined; }), done);
    });

  });

});<commit_msg>refactor: refactoring<commit_after>import { benchmark } from './benchmark';
import { Coroutine } from '..';

describe('Benchmark:', function () {
  this.timeout(10 * 1e3);

  describe('Coroutine', function () {
    it('new', function (done) {
      benchmark('Coroutine new', () => new Coroutine(function* () { return undefined; }), done);
    });

    it.skip('new async', function (done) {
      benchmark('Coroutine new async', () => new Coroutine(async function* () { return undefined; }), done);
    });

    it('iterate', function (done) {
      const iter = new Coroutine(function* () {
        while (true) {
          yield;
        }
      }, { size: 1 })[Symbol.asyncIterator]();
      benchmark('Coroutine iterate', () => void iter.next(), done);
    });

    it('iterate async', function (done) {
      const iter = new Coroutine(async function* () {
        while (true) {
          yield;
        }
      }, { size: 1 })[Symbol.asyncIterator]();
      benchmark('Coroutine iterate async', () => void iter.next(), done);
    });

  });

});
{'fraction_non_alphanumeric': 0.1914590747330961, 'fraction_numerical': 0.0071174377224199285, 'mean_word_length': 3.0286532951289398, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '78301', 'n_tokens_mistral': 434, 'n_tokens_neox': 429, 'n_words': 99}