Created
April 12, 2019 16:16
-
-
Save dario61081/0f9a24ca23588822b3a6a974ecb7634f to your computer and use it in GitHub Desktop.
timing de funciones en python
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
from functools import wraps | |
from time import time | |
def timing(f): | |
@wraps(f) | |
def wrapper(*args, **kwargs): | |
start = time() | |
result = f(*args, **kwargs) | |
end = time() | |
print(f'{f.__name__} se ha ejecutado en: {end-start}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment