def METHOD_NAME(*args, **kw):
    ts = time.time()
    result = method(*args, **kw)
    te = time.time()
    if "log_time" in kw:
        name = kw.get("log_name", method.__name__.upper())
        kw["log_time"][name] = int((te - ts) * 1000)
    else:
        print("Function %r took %2.2f ms" % (method.__name__, (te - ts) * 1000))
    return result