File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -10,23 +10,23 @@ const PORT = common.PORT;
10
10
// event loop cycles more than anything else.
11
11
const bench = common . createBenchmark ( main , {
12
12
len : [ 1 , 64 , 256 , 1024 ] ,
13
- num : [ 100 ] ,
13
+ n : [ 100 ] ,
14
14
type : [ 'send' , 'recv' ] ,
15
15
dur : [ 5 ] ,
16
16
} ) ;
17
17
18
- function main ( { dur, len, num, type } ) {
18
+ function main ( { dur, len, num : n , type } ) {
19
19
const chunk = Buffer . allocUnsafe ( len ) ;
20
20
let sent = 0 ;
21
21
let received = 0 ;
22
22
const socket = dgram . createSocket ( 'udp4' ) ;
23
23
24
24
function onsend ( ) {
25
- if ( sent ++ % num === 0 ) {
25
+ if ( sent ++ % n === 0 ) {
26
26
// The setImmediate() is necessary to have event loop progress on OSes
27
27
// that only perform synchronous I/O on nonblocking UDP sockets.
28
28
setImmediate ( ( ) => {
29
- for ( let i = 0 ; i < num ; i ++ ) {
29
+ for ( let i = 0 ; i < n ; i ++ ) {
30
30
socket . send ( chunk , PORT , '127.0.0.1' , onsend ) ;
31
31
}
32
32
} ) ;
You can’t perform that action at this time.
0 commit comments