MCPcopy
hub / github.com/prisma/prisma / deferredBench

Function deferredBench

packages/client-engine-runtime/bench/bench-utils.ts:8–20  ·  view source on GitHub ↗
(fn: () => Promise<void>)

Source from the content-addressed store, hash-verified

6import { generateUserRows } from './mock-data'
7
8export function deferredBench(fn: () => Promise<void>): Benchmark.Options {
9 return {
10 defer: true,
11 fn: function (deferred: Benchmark.Deferred) {
12 fn()
13 .then(() => deferred.resolve())
14 .catch((err) => {
15 console.error('Benchmark error:', err)
16 process.exit(1)
17 })
18 },
19 }
20}
21
22export function syncBench(fn: () => void): Benchmark.Options {
23 return { fn }

Callers 1

runBenchmarksFunction · 0.90

Calls 4

catchMethod · 0.80
errorMethod · 0.80
thenMethod · 0.65
fnFunction · 0.50

Tested by

no test coverage detected