MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / render_status

Function render_status

examples/Protobuf Example/sensor_simulator.py:148–157  ·  view source on GitHub ↗
(
    elapsed: float, total: int, sensor_count: int, vec3_count: int, kind: str, size: int
)

Source from the content-addressed store, hash-verified

146
147
148def render_status(
149 elapsed: float, total: int, sensor_count: int, vec3_count: int, kind: str, size: int
150) -> str:
151 rate = total / elapsed if elapsed > 0 else 0.0
152 return (
153 f" {kind:<6} {size:3d}B "
154 f"| sent {total:>6} ({sensor_count} sensor + {vec3_count} vec3) "
155 f"| {rate:5.1f} Hz | {elapsed:6.1f}s"
156 f"{ANSI_CLEAR_EOL}\r"
157 )
158
159
160# ---------------------------------------------------------------------------

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected