如何测量 Jetpack Compose 中的渲染时间?

编程入门 行业动态 更新时间:2024-10-25 13:16:15
本文介绍了如何测量 Jetpack Compose 中的渲染时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

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

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屋!

更多推荐

[db:关键词]

本文发布于:2023-04-23 02:29:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1034353.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:测量   时间   Jetpack   Compose

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!