Skip to content

Instantly share code, notes, and snippets.

@lukmdo
Created August 11, 2012 21:10
Show Gist options
  • Select an option

  • Save lukmdo/3327354 to your computer and use it in GitHub Desktop.

Select an option

Save lukmdo/3327354 to your computer and use it in GitHub Desktop.
timeit.timeit for python2.5
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