关于systrace
来源:5-1 页面加载耗时优化实战-1
冷色幽默
2020-12-23 15:48:11
老师,有两个问题
1、请问我在application的attachbasecontext中调用tracecompat.beginsection,在activity的onwindowfocuschange方法中endsection,生成的html中,搜索不到这一段section,是我的使用有问题吗?
2、我在activity的onresume结束的时候beginsection,在onwindowfocuschange方法endsection,systrace跑出来显示这段耗时大概在100多毫秒,但是与此同时打印出来的log却相差近2秒,为什么和systrace的walltime相差这么多呢?
1回答
LovelyChubby
2020-12-23
1.中间再添加几个begin end看下
2.绝逼不可能,你想想onresume onwindowfocus怎么可能差2s。