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

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