Checking Run time in IntelliJ IDEA
-
06-07-2019 - |
Question
How can I see how much time it took for the code to run in InteliJ?
Solution
I don't think you can with Intellij, you either have to use a profiler like Yourkit to profile the code or use some primitive benchmarks using System.currentTimeInMillis(). Alternatively you can use Apache Commons StopWatch to do some benchmarking:
StopWatch stopwatch = new StopWatch();
stopwatch.start();
... some code...
stopwatch.stop();
long timeTaken = stopWatch.getTime()
EDIT: There is a plugin available for Intellij that uses VisualVM to do profiling, you could install this as another alternative.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow