[HttpGet]
public IActionResult Get() {
var watch = new Stopwatch();
watch.Start(); //监听开始
--这里是逻辑代码块
watch.Stop(); //监听结束
var responseTimeForCompleteRequest = watch.ElapsedMilliseconds; //获取监听毫秒数
}
.net记录单个接口的耗时输出
于 2022-03-19 08:59:09 首次发布