0

如何计算TextView渲染一行文本所需的时间?

textView.setText("hello");
4

3 回答 3

1

您可以扩展 TextView 类并覆盖绘制:

@Override
public void draw(Canvas canvas) {
    //log start time
    super.draw(canvas);
    //log end time
}
于 2012-07-20T05:53:50.840 回答
0

@Maxim 的替代方法是在前后记录setText("hello");

Log.i(logTag, "start time");
textView.setText("hello");
Log.i(logTag, "end time");

如果视图仅在调用之后才呈现,这将不起作用setText。也许有人可以在评论中确认或否认这一点。

于 2012-07-20T06:32:30.963 回答
0

在eclipse中使用Android Traceview

于 2012-07-20T05:47:46.883 回答