14 lines
341 B
Python
14 lines
341 B
Python
import time
|
|
|
|
|
|
def print_execution_time(func):
|
|
def wrapper(*args, **kwargs):
|
|
time_start = time.time()
|
|
return_value = func(*args, **kwargs)
|
|
time_stop = time.time()
|
|
print('{:s} function took {:.3f}ms'.format(func.__name__, (time_stop - time_start) * 1000.0))
|
|
|
|
return return_value
|
|
|
|
return wrapper
|