@contextmanager
def trace_ms(statName):
    if _instatrace is None:
        yield
        return

    # Millisecond resolution, integer now
    now = _instatrace.now_ms()
    yield
    _instatrace.trace(statName, _instatrace.now_ms() - now)
dataset/ETHPy150Open pteichman/cobe/cobe/instatrace.py/trace_ms/original