时间使用毫秒

This commit is contained in:
白茶清欢 2022-01-13 22:20:26 +08:00
parent 940d9f327e
commit 393bc77655

View File

@ -27,7 +27,7 @@ func Response(ctx *gin.Context, code interface{}, message string, data interface
"message": message, "message": message,
"data": data, "data": data,
"trace_id": ctx.GetString("trace_id"), "trace_id": ctx.GetString("trace_id"),
"cost": time.Since(time.Unix(ctx.GetInt64("start_time"), 0)).Seconds(), "cost": time.Since(time.Unix(ctx.GetInt64("start_time"), 0)).Milliseconds(),
} }
ctx.JSON(http.StatusOK, responseData) ctx.JSON(http.StatusOK, responseData)
} }