如何将后台统计方法执行时间精确到秒级进行展示?
- 内容介绍
- 文章标签
- 相关推荐
本文共计90个文字,预计阅读时间需要1分钟。
在后台系统执行方法时,记录执行时间的方法如下:
javalong startTime=System.currentTimeMillis();// 执行方法long endTime=System.currentTimeMillis();float excTime=(float)(endTime - startTime) / 1000;System.out.println(excTime);
long startTime=System.currentTimeMillis(); //执行方法 long endTime=System.currentTimeMillis(); float excTime=(float)(endTime-startTime)/1000; System.out.println(excTime);
本文共计90个文字,预计阅读时间需要1分钟。
在后台系统执行方法时,记录执行时间的方法如下:
javalong startTime=System.currentTimeMillis();// 执行方法long endTime=System.currentTimeMillis();float excTime=(float)(endTime - startTime) / 1000;System.out.println(excTime);
long startTime=System.currentTimeMillis(); //执行方法 long endTime=System.currentTimeMillis(); float excTime=(float)(endTime-startTime)/1000; System.out.println(excTime);

