擅长:python、mysql、java
<p>当使用<code>python -m timeit</code>调用IPython和<code>timeit</code>模块时,以<em>number</em>的增长值执行同一个循环,直到计时结果超过某个阈值,从而确保时间测量基本上不受操作系统干扰。</p>
<p>您可以将<a href="https://github.com/ipython/ipython/blob/ea199a6ddc6cd80f46d0c106c7c7db95ebadc985/IPython/core/magic.py#L1923">IPython implementation of the ^{<cd3>} magic</a>与<a href="http://hg.python.org/cpython/file/70274d53c1dd/Lib/timeit.py#l294">Python ^{<cd1>} standard module</a>进行比较,以查看它们基本上是相同的。</p>
<p>因此,回答您的问题时,您可能应该复制相同的循环,直到找到<em>number</em>参数的正确值。</p>