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)");
posted @ 2018-05-18 11:25  大雾哥  阅读(444)  评论(0编辑  收藏  举报