Jetpack Compose:如何衡量渲染用户界面所用的时间? [英] Jetpack Compose: How to measure time taken to render the UI?

查看:14
本文介绍了Jetpack Compose:如何衡量渲染用户界面所用的时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我的应用程序中的一项功能尝试Jetpack Compose。出于页面加载跟踪的目的,我希望跟踪呈现片段UI所用的时间。如果是Jetpack Compose,我该怎么做?

推荐答案

var time = remember { currentTimeInMillis() }

Composables(...) {
innerMostComposable{
//If this loads, you can record the time
time -= currentTimeMillis() // this is it
}
}

这篇关于Jetpack Compose:如何衡量渲染用户界面所用的时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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