Improving benchmark measures

This commit is contained in:
David Négrier 2020-12-04 15:13:46 +01:00
parent ea6a8ff406
commit 10ee00e08a

View File

@ -53,17 +53,20 @@ async function startOneUser(): Promise<void> {
await sleep(10000); await sleep(10000);
connection.closeConnection(); connection.closeConnection();
console.log('User moved count: '+userMovedCount);
} }
(async () => { (async () => {
connectionManager.initBenchmark(); connectionManager.initBenchmark();
const promises = [];
for (let userNo = 0; userNo < 160; userNo++) { for (let userNo = 0; userNo < 160; userNo++) {
startOneUser(); const promise = startOneUser();
promises.push(promise);
// Wait 0.5s between adding users // Wait 0.5s between adding users
await sleep(125); await sleep(125);
} }
await Promise.all(promises);
console.log('User moved count: '+userMovedCount);
})(); })();