MCPcopy Create free account
hub / github.com/miguelgrinberg/python-socketio / main

Function main

examples/simple-client/sync/latency_client.py:5–16  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3
4
5def main():
6 with socketio.SimpleClient() as sio:
7 sio.connect('http://localhost:5000')
8 while True:
9 start_timer = time.time()
10 sio.emit('ping_from_client')
11 while sio.receive() != ['pong_from_server']:
12 pass
13 latency = time.time() - start_timer
14 print(f'latency is {latency * 1000:.2f} ms')
15
16 time.sleep(1)
17
18
19if __name__ == '__main__':

Callers 1

latency_client.pyFile · 0.70

Calls 4

connectMethod · 0.45
emitMethod · 0.45
receiveMethod · 0.45
sleepMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…