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
def bench(f): | |
def inner(*args, **kwargs): | |
from time import time | |
begin = time() | |
result = f(*args, **kwargs) | |
end = time() | |
print "Time elapsed: %d ms" % (end - begin) | |
return result | |
return inner |
No comments:
Post a Comment