如何知道Dio库中服务器响应的时间段?

How to know the time period server response in the Dio library?

如何知道Dio库中服务器响应的时间段?

我用postman,它returnsstatustime periodsize的响应,...

如何获取 Dio 库中的值? (我需要它来写日志)

您可以使用 stop watch 来衡量请求花费了多少

var stopWatch = Stopwatch();
    
stopWatch.start();
performReques();
stopWatch.stop();

// convert the duration to string
var elapsedString = stopWatch.elapsed.toString();

// or just get duration in seconds
var elapsedSeconds = stopWatch.elapsed.inSeconds;