java 计算函数运行时间

long start,end;
start = System.currentTimeMillis();
for (int i = 0; i < 2000000000; i++) {}
end = System.currentTimeMillis(); 
System.out.println("Run Time:" + (end - start) + "(ms)");
原文地址:https://www.cnblogs.com/dawuge/p/9055367.html