java 代码耗时计算

long time1=System.currentTimeMillis();	

long time2=System.currentTimeMillis();

System.out.println("当前程序耗时:"+(time2-time1)+"ms");

long time3=System.currentTimeMillis();

System.out.println("当前程序耗时:"+(time3-time2)+"ms");