MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / list_pop_benchmark

Function list_pop_benchmark

example_code/item_103.py:161–174  ·  view source on GitHub ↗
(count)

Source from the content-addressed store, hash-verified

159
160print("Example 8")
161def list_pop_benchmark(count):
162 def prepare():
163 return list(range(count))
164
165 def run(queue):
166 while queue:
167 queue.pop(0)
168
169 return timeit.timeit(
170 setup="queue = prepare()",
171 stmt="run(queue)",
172 globals=locals(),
173 number=1,
174 )
175
176
177print("Example 9")

Callers 1

item_103.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected