MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / wrap

Function wrap

lib/sqlalchemy/testing/profiling.py:249–257  ·  view source on GitHub ↗
(fn, *args, **kw)

Source from the content-addressed store, hash-verified

247
248 @decorator
249 def wrap(fn, *args, **kw):
250 for warm in range(warmup):
251 fn(*args, **kw)
252
253 timerange = range(times)
254 with count_functions(variance=variance):
255 for time in timerange:
256 rv = fn(*args, **kw)
257 return rv
258
259 return wrap
260

Callers 1

fixtureMethod · 0.50

Calls 1

count_functionsFunction · 0.85

Tested by 1

fixtureMethod · 0.40