add recvplot2

This commit is contained in:
remilia 2025-05-15 22:26:42 +08:00
parent cebd85e39c
commit ecb4b4e819

View File

@ -256,17 +256,33 @@ def device_recvplot():
pull.connect(C.live_push_socket)
last_ts = 0
first = True
host_host_ts_last = time.time_ns()
while True:
b = pull.recv()
host_host_ts = time.time_ns()
ts, sequence_id, encoder, buffer = b2t(b)
seq, encoder, host_ts, device_ts_low, device_ts_high, buffer = b2t(b)
ts = host_ts
if first:
last_ts = ts
first = False
continue
print((ts - last_ts) / 10 ** 6, flush=True)
last_ts = ts
host_host_ts_last = host_host_ts
@device.command('recvplot2')
def device_recvplot():
ctx = zmq.Context()
pull = ctx.socket(zmq.PULL)
pull.connect(C.live_push_socket)
host_host_ts_last = time.time_ns()
while True:
b = pull.recv()
host_host_ts = time.time_ns()
_ = b2t(b)
print((host_host_ts - host_host_ts_last) / 10 ** 6, flush=True)
host_host_ts_last = host_host_ts
@device.command('recvplotdiff')
def device_recvplotdiff():