import libAsync = require("../.."); let i: number = 1; function genTimer(t: number): libAsync.SimpleFunction { return function(next: libAsync.AsyncErrorCallback): void { setTimeout(function(): void { console.info(`[control.concurrent] ${i++}. After ${t}ms.`); next(); }, t); }; } export = function(): void { console.info("The test for libAsync.control.concurrent started."); libAsync.concurrent(3, [ genTimer(300), genTimer(300), genTimer(300), genTimer(300), genTimer(300), genTimer(300), genTimer(300), genTimer(300), genTimer(300), genTimer(300) ], function(err?: libAsync.NumericDictionary): void { console.info("[control.concurrent] done."); }); };