def time_function(f):
    func_name = f.__name__

    @wraps(f)
    def wrapped(*args, **kwargs):
        global _TIME_FUNC_ID
        id = _TIME_FUNC_ID
        _TIME_FUNC_ID += 1

        start = time.clock() * 1000

        try:
            _log_debug_as_f(
                f,
                "[FUNC START] {%s-%d}",
                (func_name, id),
            )

            r = f(*args, **kwargs)
        finally:
            end = time.clock() * 1000
            _log_debug_as_f(
                f,
                "[FUNC END] {%s-%d} %f",
                (func_name, id, start - end,),
            )

        return r

    return wrapped
dataset/ETHPy150Open matrix-org/synapse/synapse/util/logutils.py/time_function/swapped operands of `-`