import time


def runtime_measure(function):
    """
    A decorator for runtime measurement
    Custom-tailored for measuring inference latency
    Also prints str: mystr that summarizes work in SUT
    """

    def get_latency(*args, **kw):
        ts = time.time()
        result, mystr = function(*args, **kw)
        te = time.time()
        print('{:86} took {:>10.5f} sec'.format(mystr, te - ts))
        return result, ""

    return get_latency