From 10ee00e08a55c0694c2b09731cf00836007c92f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Fri, 4 Dec 2020 15:13:46 +0100 Subject: [PATCH] Improving benchmark measures --- benchmark/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/benchmark/index.ts b/benchmark/index.ts index 469a08b7..05928dd1 100644 --- a/benchmark/index.ts +++ b/benchmark/index.ts @@ -53,17 +53,20 @@ async function startOneUser(): Promise { await sleep(10000); connection.closeConnection(); - console.log('User moved count: '+userMovedCount); } (async () => { connectionManager.initBenchmark(); + const promises = []; for (let userNo = 0; userNo < 160; userNo++) { - startOneUser(); + const promise = startOneUser(); + promises.push(promise); // Wait 0.5s between adding users await sleep(125); } + await Promise.all(promises); + console.log('User moved count: '+userMovedCount); })();