Skip to content

Instantly share code, notes, and snippets.

@belyaev-pa
Created June 8, 2018 08:47
Show Gist options
  • Save belyaev-pa/6009651f49342bde194268378cf759ca to your computer and use it in GitHub Desktop.
Save belyaev-pa/6009651f49342bde194268378cf759ca to your computer and use it in GitHub Desktop.
time decorator
def timer(func):
def tmp(*args, **kwargs):
t = time.time()
res = func(*args, **kwargs)
print("f time - {} {}".format(str(time.time()-t), f.__name__, ))
return res
return tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment