Why does %timeit loop different number of times?

后端 未结 3 1832
你的背包
你的背包 2021-02-18 22:12

On Jupter Notebook, i was trying to compare time taken between the two methods for finding the index with max value.

In the Image, the first function took, 1000

3条回答
  •  耶瑟儿~
    2021-02-18 22:23

    It has a built-in option -n: " Options: -n: execute the given statement times in a loop. If this value is not given, a fitting value is chosen."docs

    So it choses the number of loops itself if not specified.

提交回复
热议问题