Hacker News new | ask | show | jobs
by mjschultz 4502 days ago
Does the --setup statement really get timed?

My reading of the docs[1] has always led me to believe that it doesn't. For example, "It is possible to provide a setup statement that is executed only once at the beginning"

[1]: http://docs.python.org/2/library/timeit.html

2 comments

It doesn't get timed. You can quickly test this by adding an expensive operation to your setup and checking that it doesn't affect the resulting time.
Aaah, ok. I totally didn't read the --setup arg.