如何测量 Jetpack Compose 中的渲染时间? [英] How can I measure the render time in Jetpack Compose?

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

问题描述

我正在评估是使用可绘制图标还是字体图标,因此想要衡量每个实现的渲染时间.

I am evaluating whether to use drawable icons or font icons and therefore want to measure each implementations rendering time.

我已经尝试使用 Kotlin 的 measureTimeMillis(()) 没有任何运气.
通过 System.currentTimeInMillis() 计算时间似乎也不起作用.

I have already tried usings Kotlin's measureTimeMillis(()) without any luck.
Calculating the time through System.currentTimeInMillis() seems to not work either.

是否有任何专业方法可以可靠地测量 Composable 的渲染时间?

Is there any professional approach to measuring the render time of a Composable reliably?

推荐答案

android 开发工具包中有一个新工具.它被称为宏观基准测试.允许您放置跟踪点并测量时间.在官方 youtube 频道或文档上查看.除了上面评论中指出的那样,我猜 Firebase 也可能提供类似的东西.但是如果你在开发时想要精确的数据,那就去宏吧

There's A new tool in the android development kit. It is called as Macro Benchmarking. Allows you to put trace points and measure time as well. Check that out on the official youtube channel or the docs. Other than that as pointed out in the comment above, I guess Firebase may also offer something similar. But if you want precise data at development time, go for the Macro thing

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

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