<commit_before>var co = require("co");
var CoControl = require("./");
var thunkify = require("thunkify");

var setTimeout = require("./speed/"+process.argv[2]);
var iterations = 100;

function tester(fn, cb){
	var start = process.hrtime();
	
	var done = function(err){
		var laps = process.hrtime(start);
		var time = laps[0] * 1e9 + laps[1]
		cb(err, time);
	}

	fn(done, "a");
}

co(function*(){

	var controller = new CoControl();

	var tests = Object.keys(setTimeout);
	var numTests = tests.length;

	for(var i=0; i<numTests; i++){
		var test = tests[i];
		var fn = thunkify(function(cb){
			tester(setTimeout[test], cb);
		});
		for(var j=0; j<iterations; j++){
			controller.start(test+"-"+j, fn());
		}
	}

	var results = {};

	var headToHead = {};
	var wins = {};

	for(var i=0; i<numTests; i++){
		var test = tests[i];
		for(var j=0; j<iterations; j++){
			results[test] = yield controller.get(test+"-"+j);<commit_msg>better name for the test suite var<commit_after>var co = require("co");
var CoControl = require("./");
var thunkify = require("thunkify");

var testSuite = require("./speed/"+process.argv[2]);
var iterations = 100;

function tester(fn, cb){
	var start = process.hrtime();
	
	var done = function(err){
		var laps = process.hrtime(start);
		var time = laps[0] * 1e9 + laps[1]
		cb(err, time);
	}

	fn(done, "a");
}

co(function*(){

	var controller = new CoControl();

	var tests = Object.keys(testSuite);
	var numTests = tests.length;

	for(var i=0; i<numTests; i++){
		var test = tests[i];
		var fn = thunkify(function(cb){
			tester(testSuite[test], cb);
		});
		for(var j=0; j<iterations; j++){
			controller.start(test+"-"+j, fn());
		}
	}

	var results = {};

	var headToHead = {};
	var wins = {};

	for(var i=0; i<numTests; i++){
		var test = tests[i];
		for(var j=0; j<iterations; j++){
			results[test] = yield controller.get(test+"-"+j);
{'fraction_non_alphanumeric': 0.20085470085470086, 'fraction_numerical': 0.01282051282051282, 'mean_word_length': 4.075880758807588, 'pattern_counts': {'":': 0, '<': 11, '<?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': '5951820', 'n_tokens_mistral': 767, 'n_tokens_neox': 702, 'n_words': 175}