Skip to content

Instantly share code, notes, and snippets.

@suryadana
Last active May 17, 2018 08:43
Show Gist options
  • Save suryadana/f54a65c3f75f85987b23f43f6706dc03 to your computer and use it in GitHub Desktop.
Save suryadana/f54a65c3f75f85987b23f43f6706dc03 to your computer and use it in GitHub Desktop.
Check function speed Python
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