Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3c8a609

Browse filesBrowse files
brunocrohtargos
authored andcommitted
benchmark: update num to n in dgram offset-length
PR-URL: #59872 Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent ef90b0f commit 3c8a609
Copy full SHA for 3c8a609

File tree

Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Open diff view settings
Collapse file

‎benchmark/dgram/single-buffer.js‎

Copy file name to clipboardExpand all lines: benchmark/dgram/single-buffer.js
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@ const PORT = common.PORT;
1010
// event loop cycles more than anything else.
1111
const bench = common.createBenchmark(main, {
1212
len: [1, 64, 256, 1024],
13-
num: [100],
13+
n: [100],
1414
type: ['send', 'recv'],
1515
dur: [5],
1616
});
1717

18-
function main({ dur, len, num, type }) {
18+
function main({ dur, len, num: n, type }) {
1919
const chunk = Buffer.allocUnsafe(len);
2020
let sent = 0;
2121
let received = 0;
2222
const socket = dgram.createSocket('udp4');
2323

2424
function onsend() {
25-
if (sent++ % num === 0) {
25+
if (sent++ % n === 0) {
2626
// The setImmediate() is necessary to have event loop progress on OSes
2727
// that only perform synchronous I/O on nonblocking UDP sockets.
2828
setImmediate(() => {
29-
for (let i = 0; i < num; i++) {
29+
for (let i = 0; i < n; i++) {
3030
socket.send(chunk, PORT, '127.0.0.1', onsend);
3131
}
3232
});

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.