(client, q, time)
| 23 | } |
| 24 | |
| 25 | const 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 | |
| 38 | const run = async () => { |
| 39 | const client = new pg.Client() |