MCPcopy Index your code
hub / github.com/brianc/node-postgres / bench

Function bench

packages/pg/bench.js:25–36  ·  view source on GitHub ↗
(client, q, time)

Source from the content-addressed store, hash-verified

23}
24
25const bench = async (client, q, time) => {
26 const start = performance.now()
27 let count = 0
28 // eslint-disable-next-line no-constant-condition
29 while (true) {
30 await exec(client, q)
31 count++
32 if (performance.now() - start > time) {
33 return count
34 }
35 }
36}
37
38const run = async () => {
39 const client = new pg.Client()

Callers 1

runFunction · 0.85

Calls 1

execFunction · 0.70

Tested by

no test coverage detected