测量颤动应用程序的启动时间 [英] Measure flutter application startup time

查看:61
本文介绍了测量颤动应用程序的启动时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找某种方法来测量应用程序的启动时间.从单击应用程序图标的那一刻到用户例如可以看到登录页面的那一刻.

I am looking for some way to measure startup time of an application. From a moment of clicking the app icon till the moment, when for example login page is visible to the user.

推荐答案

运行

flutter run --trace-startup --profile

跟踪输出被保存为Flutter项目的 build 目录下的名为 start_up_info.json 的JSON文件.输出列出了从应用程序启动到这些跟踪事件所花费的时间(以微秒为单位):

The trace output is saved as a JSON file called start_up_info.json under the build directory of your Flutter project. The output lists the elapsed time from app startup to these trace events (captured in microseconds):

  • 输入Flutter引擎代码的时间.
  • 是时候渲染应用的第一帧了.
  • 初始化Flutter框架的时间.
  • 完成Flutter框架初始化的时间.

例如:

content_copy
{
  "engineEnterTimestampMicros": 96025565262,
  "timeToFirstFrameMicros": 2171978,
  "timeToFrameworkInitMicros": 514585,
  "timeAfterFrameworkInitMicros": 1657393
}

来源

这篇关于测量颤动应用程序的启动时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆