summaryrefslogtreecommitdiff
path: root/includes/external/signal/node_modules/asynckit/bench.js
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2024-03-30 23:40:33 +0100
committerRaindropsSys <raindrops@equestria.dev>2024-03-30 23:40:33 +0100
commit6b796258d413f00e498ce7f80f73a9f6c061f29c (patch)
tree49e64a5dd4cde2acff7f0a93ed3f8e20e1cb2dc8 /includes/external/signal/node_modules/asynckit/bench.js
parent5860551daa0f60103ad24e93da29f401a653f144 (diff)
downloadpluralconnect-6b796258d413f00e498ce7f80f73a9f6c061f29c.tar.gz
pluralconnect-6b796258d413f00e498ce7f80f73a9f6c061f29c.tar.bz2
pluralconnect-6b796258d413f00e498ce7f80f73a9f6c061f29c.zip
Updated 5 files, added 2 files, deleted 495 files and renamed 7 files (automated)
Diffstat (limited to 'includes/external/signal/node_modules/asynckit/bench.js')
-rw-r--r--includes/external/signal/node_modules/asynckit/bench.js76
1 files changed, 0 insertions, 76 deletions
diff --git a/includes/external/signal/node_modules/asynckit/bench.js b/includes/external/signal/node_modules/asynckit/bench.js
deleted file mode 100644
index c612f1a..0000000
--- a/includes/external/signal/node_modules/asynckit/bench.js
+++ /dev/null
@@ -1,76 +0,0 @@
-/* eslint no-console: "off" */
-
-var asynckit = require('./')
- , async = require('async')
- , assert = require('assert')
- , expected = 0
- ;
-
-var Benchmark = require('benchmark');
-var suite = new Benchmark.Suite;
-
-var source = [];
-for (var z = 1; z < 100; z++)
-{
- source.push(z);
- expected += z;
-}
-
-suite
-// add tests
-
-.add('async.map', function(deferred)
-{
- var total = 0;
-
- async.map(source,
- function(i, cb)
- {
- setImmediate(function()
- {
- total += i;
- cb(null, total);
- });
- },
- function(err, result)
- {
- assert.ifError(err);
- assert.equal(result[result.length - 1], expected);
- deferred.resolve();
- });
-}, {'defer': true})
-
-
-.add('asynckit.parallel', function(deferred)
-{
- var total = 0;
-
- asynckit.parallel(source,
- function(i, cb)
- {
- setImmediate(function()
- {
- total += i;
- cb(null, total);
- });
- },
- function(err, result)
- {
- assert.ifError(err);
- assert.equal(result[result.length - 1], expected);
- deferred.resolve();
- });
-}, {'defer': true})
-
-
-// add listeners
-.on('cycle', function(ev)
-{
- console.log(String(ev.target));
-})
-.on('complete', function()
-{
- console.log('Fastest is ' + this.filter('fastest').map('name'));
-})
-// run async
-.run({ 'async': true });