Created
December 28, 2018 08:36
-
-
Save zahash/0aa4a7c1963025fab9c9ff4018b1f23b to your computer and use it in GitHub Desktop.
This file contains 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 time_it(func): | |
def wrapper(*args, **kwargs): | |
start = time.time() | |
func(*args, **kwargs) | |
end = time.time() | |
return (end - start)*1000 | |
return wrapper |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
decorator function to calculate the execution time of any function