MCPcopy
hub / github.com/tsrpc/tsrpc / main

Function main

try/client/http.ts:8–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6});
7
8async function main() {
9 const P = 50, N = 1000;
10 let max = 0;
11 console.time(`test ${P}/${N}`);
12 for (let i = 0, len = N / P; i < len; ++i) {
13 let res = await Promise.all(Array.from({ length: P }, () => {
14 let start = Date.now();
15 return client.callApi('a/b/c/Test', { name: '123' }).then(() => Date.now() - start);
16 }));
17 max = Math.max(res.max(), max)
18 }
19 console.timeEnd(`test ${P}/${N}`);
20 console.log('max', max)
21}
22main();

Callers 1

http.tsFile · 0.70

Calls 2

logMethod · 0.65
callApiMethod · 0.45

Tested by

no test coverage detected