Java Date类 currentTimeMillis()
Date类
例:
int b[] = new int[100000];
long begin = System.currentTimeMillis();
for (int i = 0; i < 100000; i++)
b[i] = i * 10;
long over = System.currentTimeMillis();
System.out.println(over - begin);
结果:
3