How do I calculate the time needed for TextView
to render a line of text?
textView.setText("hello");
You can extend TextView class and override draw:
@Override
public void draw(Canvas canvas) {
//log start time
super.draw(canvas);
//log end time
}
Use Android Traceview in eclipse
An alternative to @Maxim is to just log before and after setText("hello");
Log.i(logTag, "start time");
textView.setText("hello");
Log.i(logTag, "end time");
This won't work if the view is only rendered after the call to setText
though. Maybe someone can confirm or deny that in a comment.