Last active
May 17, 2018 08:43
-
-
Save suryadana/f54a65c3f75f85987b23f43f6706dc03 to your computer and use it in GitHub Desktop.
Check function speed 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 datetime import datetime | |
def check_func(method): | |
def wrapper(*args, **kwargs): | |
t0 = datetime.now() | |
result = method(*args, **kwargs) | |
t1 = datetime.now() | |
print('Run with {:.16f} seccond'.format((t1-t0).total_seconds())) | |
return result | |
return wrapper |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment