import functools
import time


def timer(func):
	"""
	Wrapper to determine how long a function takes to process. Prints out the time in python terminal. See https://realpython.com/primer-on-python-decorators/#timing-functions
	"""
	@functools.wraps(func)
	def wrapper_timer(*args, **kwargs):
		start_time = time.perf_counter()
		value = func(*args, **kwargs)
		end_time = time.perf_counter()
		run_time = end_time - start_time
		print("Finished '{}' in '{}' seconds".format(func.__name__, run_time))
		return value

	return wrapper_timer