Skip to content

Instantly share code, notes, and snippets.

@csytan
Created December 15, 2010 21:38
Show Gist options
  • Save csytan/742653 to your computer and use it in GitHub Desktop.
Save csytan/742653 to your computer and use it in GitHub Desktop.
import timeit
t = timeit.Timer(stmt="""\
def test(pwd, n_iter):
for i in range(n_iter):
pwd = hashlib.sha1(pwd).hexdigest()
test('hello', 50000)
""", setup='import hashlib')
print t.timeit(100) / 100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment