gpt4 book ai didi

android - 在应用程序代码 android 中使用 systrace

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:28:23 24 4
gpt4 key购买 nike

android中的文档说

you can use the methods of the Trace class to add instrumentation to 
your application code and see the results in a Systrace report.

我已将以下方法添加到我的代码中

Trace.beginSection("test-trace");  

// block of code

Trace.endSection();

现在在哪里可以查看这部分的结果。我从 android 设备监视器启动 systrace 工具并将其记录 30 秒(执行执行上述 block 的按钮单击)。它生成 trace.html 文件,但我如何从该 html 文件中获取上述部分信息

最佳答案

它在那里,我自己搜索了大约一个小时:D

如果您只有一个线程,则显示在 UI 线程行中,否则显示在您定义的线程行中。

如果你找不到它,使用搜索工具箱,在页面的右上角,在那里输入'test-trace',它会显示详细的开始时间

:)

this screenshot may help you

关于android - 在应用程序代码 android 中使用 systrace,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30149363/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com