java 查看某一段代码或方法运行时间的方法:在没有插件的情况下,可以使用代码来查看运行时间。
- long start = System.currentTimeMillis(); //获取开始时间 //要测试的程序或方法long end=System.currentTimeMillis(); //获取结束时间 System.out.println("程序运行时间: "+(end-start)+"ms");
就爱阅读 www.92to.com 网友整理上传, 为您提供最全的知识大全, 期待您的分享,转载请注明出处。
来源: http://www.92to.com/bangong/2017/03-06/18201699.html