timeit function

suggest change

Profiling repetition of elements in an array

>>> import timeit
>>> timeit.timeit('list(itertools.repeat("a", 100))', 'import itertools', number = 10000000)
10.997665435877963
>>> timeit.timeit('["a"]*100', number = 10000000)
7.118789926862576

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents