如何知道Dio库中的时间段服务器响应?
我使用postman,它返回status
, time period
,size
的响应, ...
如何在Dio lib 中获取值?(我需要它来写日志)
您可以使用秒表来测量请求花费了多少
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;