[New-bugs-announce] [issue18252] timeit makes code run faster?

icedream91 report at bugs.python.org
Tue Jun 18 11:25:07 CEST 2013

New submission from icedream91:

I used Python 3.3.2 to try this problem: http://projecteuler.net/problem=23 , and I got a correct answer.

When I wanted to check how long it took, I found something strange:
When I ran 23.py directly, it showed that it took about 13s. But if I use timeit module, it showed that it only took about 9s! I have tried these for some times, in both Ubuntu 12.10 and Windows 8, I don't understand why timeit will make the same code run faster.


components: Benchmarks
files: 23.py
messages: 191390
nosy: icedream91
priority: normal
severity: normal
status: open
title: timeit makes code run faster?
versions: Python 3.3
Added file: http://bugs.python.org/file30633/23.py

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list