0

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

我使用postman,它返回status, time period,size的响应, ...

在此处输入图像描述

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

4

1 回答 1

0

您可以使用秒表来测量请求花费了多少

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;
于 2020-07-08T02:48:38.977 回答