import time


def wallclock(func, *args, **kwargs):
    """Measure time taken by func, print result."""
    start = time.time()
    returned = func(*args, **kwargs)
    end = time.time()
    print("{} took {:.3f} sec.".format(func.__name__, (end - start)))
    return returned