2009-07-31 2119 views

回答

11

我不认为你可以用的IntelliJ,你要么必须使用一个分析器像Yourkit来分析代码或使用System.currentTimeInMillis用一些原始基准()。或者您可以使用阿帕奇百科全书秒表做一些基准测试:

StopWatch stopwatch = new StopWatch(); 
stopwatch.start(); 
... some code... 
stopwatch.stop(); 
long timeTaken = stopWatch.getTime() 

https://commons.apache.org/proper/commons-lang/javadocs/api-2.6/org/apache/commons/lang/time/StopWatch.html

编辑:有一个可用的IntelliJ插件使用的VisualVM做分析,你可以安装这是另一种选择。

http://plugins.intellij.net/plugin/?id=3749

+0

谢谢,VisualVM插件完成这项工作。此外,看起来YourKit是一种共享软件,即使对于“自由进化”也需要注册,只是未来读者的参考。 – Eran 2009-07-31 01:16:04

相关问题