Skip to content

Commit 6a70ae8

Browse files
committed
add wall time to log
1 parent e5823cf commit 6a70ae8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

examples/video-stream/video_play.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,18 @@ async def _push_frames(
173173
await asyncio.sleep(0)
174174

175175
async def _log_fps(av_sync: rtc.AVSynchronizer):
176+
start_time = asyncio.get_running_loop().time()
176177
while True:
177178
await asyncio.sleep(2)
179+
wall_time = asyncio.get_running_loop().time() - start_time
178180
diff = av_sync.last_video_time - av_sync.last_audio_time
179-
180181
logger.info(
181-
f"fps: {av_sync.actual_fps:.2f}, video_time: {av_sync.last_video_time:.3f}s, "
182+
f"fps: {av_sync.actual_fps:.2f}, wall_time: {wall_time:.3f}s, "
183+
f"video_time: {av_sync.last_video_time:.3f}s, "
182184
f"audio_time: {av_sync.last_audio_time:.3f}s, diff: {diff:.3f}s"
183185
)
184186

187+
185188
try:
186189
while True:
187190
streamer.reset()

0 commit comments

Comments
 (0)