Created
August 11, 2012 21:10
-
-
Save lukmdo/3327354 to your computer and use it in GitHub Desktop.
timeit.timeit for python2.5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import timeit | |
| try: | |
| timeit.timeit | |
| except AttributeError: | |
| # adding "Convenience function..." from py >= 2.7 | |
| timeit.timeit = lambda stmt="pass", setup="pass", timer=timeit.default_timer, number=timeit.default_number: \ | |
| timeit.Timer(stmt, setup, timer).timeit(number) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment