MCPcopy
hub / github.com/jackc/pgx / BenchmarkContextWatcherCancellable

Function BenchmarkContextWatcherCancellable

pgconn/ctxwatch/context_watcher_test.go:175–184  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

173}
174
175func BenchmarkContextWatcherCancellable(b *testing.B) {
176 cw := ctxwatch.NewContextWatcher(&testHandler{handleCancel: func(context.Context) {}, handleUnwatchAfterCancel: func() {}})
177
178 ctx := b.Context()
179
180 for b.Loop() {
181 cw.Watch(ctx)
182 cw.Unwatch()
183 }
184}

Callers

nothing calls this directly

Calls 3

WatchMethod · 0.95
UnwatchMethod · 0.95
NewContextWatcherFunction · 0.92

Tested by

no test coverage detected