From 6486b8328bcf478f7648e51c65ce91c1523ec56a Mon Sep 17 00:00:00 2001 From: lijun Date: Mon, 20 Jan 2025 18:52:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8v3=E8=8E=B7=E5=8F=96=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E5=B8=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler/tool.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/handler/tool.go b/handler/tool.go index bd382c3..21d56dd 100644 --- a/handler/tool.go +++ b/handler/tool.go @@ -214,6 +214,7 @@ func subscribeAndHandleMessagesV3(ws *websocket.Conn, device_id int) { //定时器,发送计数器 t_count := 0 t := 0 + //计算帧率 for { //从service获取当前帧 img, c := service.GetDeviceCurrentFrameV3(device_id) @@ -243,11 +244,11 @@ func subscribeAndHandleMessagesV3(ws *websocket.Conn, device_id int) { break } c = count + t++ err5 := img.Close() if err5 != nil { log.Printf("img close err:%v", err) } else { - t++ if t%10 == 0 { log.Printf("device:%d send frame count:%d,img is closed", device_id, c) }