Steven5007

导航

时间差

long startTime = System.currentTimeMillis();
//测试时间
long endTime = System.currentTimeMillis();
long timeLong = endTime - startTime;
//long类型时间差转为double类型时间差,单位毫秒
double timeDouble= Double.parseDouble(Long.toString(timeLong));
System.out.println("时间差" + timeDouble+ "毫秒,即 " + timeDouble/(double)1000 + "");

 

posted on 2019-12-31 15:00  Steven5007  阅读(195)  评论(0编辑  收藏  举报