From 04acd6a47f803a7f685693a913246006563c3690 Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Thu, 22 Sep 2016 13:00:27 +0200 Subject: [PATCH] benchmark: use 'yes' instead of echo in a loop This changes child-process-exec-stdout benchmark to use 'yes' instead of echo in a while loop. This makes this benchmark consistent with child-process-read which already uses `yes` and allows this benchmark to be executed on Windows. --- benchmark/child_process/child-process-exec-stdout.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/benchmark/child_process/child-process-exec-stdout.js b/benchmark/child_process/child-process-exec-stdout.js index 6194f66b55d987..7b93aacff8532d 100644 --- a/benchmark/child_process/child-process-exec-stdout.js +++ b/benchmark/child_process/child-process-exec-stdout.js @@ -20,8 +20,7 @@ function main(conf) { const msg = `"${'.'.repeat(len)}"`; msg.match(/./); const options = {'stdio': ['ignore', 'pipe', 'ignore']}; - // NOTE: Command below assumes bash shell. - const child = exec(`while\n echo ${msg}\ndo :; done\n`, options); + const child = exec(`yes ${msg}`, options); var bytes = 0; child.stdout.on('data', function(msg) {