from functools import wraps
from timeit import default_timer


def vocalTimeit(*args, **kwargs):
    '''provides the decorator @vocalTime which will print the name of the
    function as well as the execution time in seconds
    https://gist.github.com/Susensio/61f4fee01150caaac1e10fc5f005eb75
    '''

    def decorator(function):
        @wraps(function)
        def wrapper(*args, **kwargs):
            start = default_timer()
            results = function(*args, **kwargs)
            end = default_timer()
            print('{} execution time: {} s'.format(function.__name__, end-start))
            return results
        return wrapper
    return decorator

