- 博客(1)
- 收藏
- 关注
原创 Java中记录程序执行的时间
Java中记录程序执行的时间 在程序中,我们常常需要记录某一段程序在执行时所用的时间,在这里和大家分享一种比较简便的算法。 Long startTime = System.currentTimeMillis(); //在这里写入需要记录执行时间的代码 int a=in.nextInt(); int b=in.nextInt(); System.out.println(a+b); Long endTime = System.currentTimeMillis(); Syste
2021-07-13 00:45:50
1541
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人