This commit is contained in:
laodaming 2023-10-09 17:57:54 +08:00
parent 0ce7cf8f17
commit 83ef491069

View File

@ -79,7 +79,8 @@ func (l *TestAiLogic) TestAi(req *types.TestAiReq, userinfo *auth.UserInfo) (res
return resp.SetStatusWithMessage(basic.CodeServiceErr, v)
}
end := time.Now().UTC().UnixMilli() - begin
return resp.SetStatus(basic.CodeOK, fmt.Sprintf("耗时:%d ms", end))
avg := end / int64(req.Num)
return resp.SetStatus(basic.CodeOK, fmt.Sprintf("总耗时:%d ms平均耗时%d ms", end, avg))
}
// 处理逻辑后 w,r 如:重定向, resp 必须重新处理