From 24bc951b90abfe7a365ef6323888d51fde479552 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 30 Aug 2024 20:49:02 +0200 Subject: [PATCH] docs: code cleanup in examples MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- examples/typescript/http-client-pool/src/main.ts | 4 +--- examples/typescript/smtp-client-pool/src/main.ts | 7 +++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/examples/typescript/http-client-pool/src/main.ts b/examples/typescript/http-client-pool/src/main.ts index 9848d21f..13cfd0e2 100644 --- a/examples/typescript/http-client-pool/src/main.ts +++ b/examples/typescript/http-client-pool/src/main.ts @@ -20,9 +20,7 @@ for (const workerFunction of ['node_fetch', 'fetch', 'axios']) { ) const elapsedTime = performance.now() - now console.info( - `Received in ${elapsedTime.toFixed( - 2 - )}ms an array with ${responses.length.toString()} responses from ${parallelism.toString()} parallel requests made with HTTP client pool task function ${workerFunction} on ${requestUrl}:\n`, + `Received in ${elapsedTime.toFixed(2)}ms an array with ${responses.length.toString()} responses from ${parallelism.toString()} parallel requests made with HTTP client pool task function ${workerFunction} on ${requestUrl}:\n`, responses ) } catch (error) { diff --git a/examples/typescript/smtp-client-pool/src/main.ts b/examples/typescript/smtp-client-pool/src/main.ts index a06a800c..ceea27a4 100644 --- a/examples/typescript/smtp-client-pool/src/main.ts +++ b/examples/typescript/smtp-client-pool/src/main.ts @@ -28,12 +28,11 @@ for (const to of tos) { try { const now = performance.now() - await smtpClientPool.mapExecute(smtpMessages) + const responses = await smtpClientPool.mapExecute(smtpMessages) const elapsedTime = performance.now() - now console.info( - `Send in parallel in ${elapsedTime.toFixed( - 2 - )}ms ${tos.length.toString()} mails with SMTP client pool` + `Send in parallel in ${elapsedTime.toFixed(2)}ms ${tos.length.toString()} mails with SMTP client pool:\n`, + responses ) } catch (error) { console.error(error) -- 2.34.1