long start = System.currentTimeMillis();
int N = 1000;
for (int i = 0; i < N; i++) {
ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) v.getLayoutParams();
lp.topMargin = (lp.topMargin + 1) % 31;
lp.leftMargin = (lp.leftMargin + 1) % 31;
v.requestLayout();
v.invalidate();
ViewGroup p = (ViewGroup) v.getParent();
p.layout(0, 0, 1000 + (i % 2), 500 + (i % 2));
}
Log.d(tag(), "Time: " + (float) (System.currentTimeMillis() - start) / N * 1000 + "mics");