Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save valeria-aynbinder-edu/8325c52963de33ae2132d3ee5c0f4c34 to your computer and use it in GitHub Desktop.
Save valeria-aynbinder-edu/8325c52963de33ae2132d3ee5c0f4c34 to your computer and use it in GitHub Desktop.
import time
def performance_log(func):
def decorator(*args, **kwargs):
start = time.perf_counter()
result = func(*args, **kwargs)
end = time.perf_counter()
print(f"Execution time is: {end-start}")
return result
return decorator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment