import time


def time_fn(lbd):
    """
        Times an expression.

        If you need to time the operation:
            result = heavy_function()
        Then just write:
            result = time_fn(lambda : heavy_function())
    """
    start = time.time()
    res = lbd()
    end = time.time()
    print("TIME: %s" % (end - start))
    return res