flutter - 如何知道 Dio 库中的时间段服务器响应?
解决方案
您可以使用秒表来测量请求花费了多少
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;
推荐阅读
- fthtml - 你如何在 ftHTML 中连接字符串
- docker - 在数字海洋上运行 minikube 并尝试从外部访问
- javascript - 何时使用 call 或在 JavaScript 中使用 call 有什么好处?
- python-3.x - 从被调用函数访问类属性?
- sap-cloud-sdk - 使用 SAP Cloud SDK 生成的 VDM 获取导航属性
- scala - Databricks - 尝试在单元格之间捕获
- javascript - 使用fabric js在画布中进行多项选择时过滤选择
- boolean - 线性规划中的布尔表达式
- json - 解析 curl 输出
- html - 如何使用 CSS 从下到上显示/填充 div 以获得以下效果