File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ var path = require('path');
1818var assert = require ( 'assert' )
1919var d3_queue = require ( 'd3-queue' ) ;
2020var module = require ( '../lib/index.js' ) ;
21- var queue = d3_queue . queue ( argv . concurrency ) ;
21+ var queue = d3_queue . queue ( ) ;
2222var runs = 0 ;
2323
2424function run ( cb ) {
@@ -31,12 +31,15 @@ function run(cb) {
3131 } ) ;
3232}
3333
34+ // Start monitoring time before async work begins within the defer iterator below.
35+ // AsyncWorkers will kick off actual work before the defer iterator is finished,
36+ // and we want to make sure we capture the time of the work of that initial cycle.
37+ var time = + ( new Date ( ) ) ;
38+
3439for ( var i = 0 ; i < argv . iterations ; i ++ ) {
3540 queue . defer ( run ) ;
3641}
3742
38- var time = + ( new Date ( ) ) ;
39-
4043queue . awaitAll ( function ( error ) {
4144 if ( error ) throw error ;
4245 if ( runs != argv . iterations ) {
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ var d3_queue = require('d3-queue');
2020var module = require ( '../lib/index.js' ) ;
2121
2222var H = new module . HelloObjectAsync ( 'park bench' ) ;
23- var queue = d3_queue . queue ( argv . concurrency ) ;
23+ var queue = d3_queue . queue ( ) ;
2424var runs = 0 ;
2525
2626function run ( cb ) {
@@ -33,12 +33,15 @@ function run(cb) {
3333 } ) ;
3434}
3535
36+ // Start monitoring time before async work begins within the defer iterator below.
37+ // AsyncWorkers will kick off actual work before the defer iterator is finished,
38+ // and we want to make sure we capture the time of the work of that initial cycle.
39+ var time = + ( new Date ( ) ) ;
40+
3641for ( var i = 0 ; i < argv . iterations ; i ++ ) {
3742 queue . defer ( run ) ;
3843}
3944
40- var time = + ( new Date ( ) ) ;
41-
4245queue . awaitAll ( function ( error ) {
4346 if ( error ) throw error ;
4447 if ( runs != argv . iterations ) {
You can’t perform that action at this time.
0 commit comments