Skip to content

Instantly share code, notes, and snippets.

@wila-diaz
Created August 8, 2020 07:49
Show Gist options
  • Save wila-diaz/bbf341af0118b24e4a4f44728ec1d854 to your computer and use it in GitHub Desktop.
Save wila-diaz/bbf341af0118b24e4a4f44728ec1d854 to your computer and use it in GitHub Desktop.
Time Controller Decorator
def controller_time(func):
def wrapper(*args, **kwargs):
initial_time = time.time()
func(*args,**kwargs)
final_time = time.time()
seconds = final_time - initial_time
print(f'The function {func.__name__} took {seconds} seconds')
return wrapper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment