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

Function list_append_benchmark

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

Source from the content-addressed store, hash-verified

138import timeit
139
140def list_append_benchmark(count):
141 def run(queue):
142 for i in range(count):
143 queue.append(i)
144
145 return timeit.timeit(
146 setup="queue = []",
147 stmt="run(queue)",
148 globals=locals(),
149 number=1,
150 )
151
152
153print("Example 7")

Callers 1

item_103.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected