def _time_into_runtime_info(runtime_info: RuntimeInfo, name: str):
    """A context manager that appends timing information into a cg.RuntimeInfo.

    Timings are reported in fractional seconds as reported by `time.monotonic()`.

    Args:
        runtime_info: The runtime information object whose `.timings_s` dictionary will be updated.
        name: A string key name to use in the dictionary.
    """
    start = time.monotonic()
    yield
    runtime_info.timings_s[name] = time.monotonic() - start
A context manager that appends timing information into a cg.RuntimeInfo.

    Timings are reported in fractional seconds as reported by `time.monotonic()`.

    Args:
        runtime_info: The runtime information object whose `.timings_s` dictionary will be updated.
        name: A string key name to use in the dictionary.
    
cirq-google/cirq_google/workflow/quantum_runtime.py