This commit is contained in:
laodaming 2023-11-22 18:17:52 +08:00
parent 2039414e2a
commit baba117865

View File

@ -97,11 +97,11 @@ func (l *RenderNotifyLogic) RenderNotify(req *types.RenderNotifyReq, userinfo *a
//转换unity真实处理时间
duration, err := time.Parse("15:04:05.9999999", req.CostTime)
if err != nil {
fmt.Println("解析时间错误:", err)
logx.Error("解析时间错误:", err)
return resp.SetStatusWithMessage(basic.CodeFileUploadErr, "转换unity时间错误")
}
// 将时间对象转换为毫秒数
unityRealTakesTime := duration.Nanosecond() / 1e6 + duration.Second()*1000 + duration.Minute() * 6000 + duration.Hour()*3600000
unityRealTakesTime := duration.Nanosecond()/1e6 + duration.Second()*1000 + duration.Minute()*6000 + duration.Hour()*3600000
if ws.conn != nil {
//发送到出口
ws.sendRenderResultData(websocket_data.RenderImageRspMsg{
@ -110,7 +110,7 @@ func (l *RenderNotifyLogic) RenderNotify(req *types.RenderNotifyReq, userinfo *a
RenderProcessTime: &websocket_data.RenderProcessTime{
UnityRenderTakesTime: fmt.Sprintf("%dms", unityRenderEndTime-unityRenderBeginTime),
UploadUnityRenderImageTakesTime: fmt.Sprintf("%dms", uploadUnityRenderImageTakesTime),
UnityRealTakesTime: fmt.Sprintf("%dms",unityRealTakesTime),
UnityRealTakesTime: fmt.Sprintf("%dms", unityRealTakesTime),
},
})
logx.Info("渲染回调成功,渲染结果图片为:", uploadRes.ResourceUrl)