Skip to content

Instantly share code, notes, and snippets.

View lcsbossle's full-sized avatar

Lucas Bossle lcsbossle

  • Curitiba, Brazil
View GitHub Profile
@lcsbossle
lcsbossle / timed.py
Created June 21, 2021 00:16
Timer decorator for python functions
import time
def timed(func):
def function_timer(*args, **kwargs):
start = time.time()
result = func(*args, **kwargs)
end = time.time()
runtime = (end - start)*1000
message = f"Function [{func.__name__}] executed in {runtime} ms"