Skip to content

Instantly share code, notes, and snippets.

@zinking
Last active January 1, 2016 23:08
Show Gist options
  • Save zinking/8214291 to your computer and use it in GitHub Desktop.
Save zinking/8214291 to your computer and use it in GitHub Desktop.
def foo():
pass;
if __name__ == '__main__':
import timeit
print(timeit.timeit("test()", setup="from __main__ import test", number=10))
if __name__=='__main__':
from timeit import Timer
t = Timer(lambda: foo(bar) )
print t.timeit(number=1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment