Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can we measure code performance in IntelliJ IDE

I am using IntelliJ IDE for Java application development. I was wondering if there is a way to calculate the time it takes for a particular function to complete from IntelliJ.I googled around but some mentioned about dotTrace but I couldn't really get a grasp of, if it can be linked from IntelliJ. Any links or answers if its possible is highly appreciated.

Thanks

like image 608
Shenoy Tinny Avatar asked Feb 20 '15 23:02

Shenoy Tinny


People also ask

Does IntelliJ have a profiler?

By default, IntelliJ IDEA runs both profilers in parallel to provide most accurate results. While it is possible to use the supported profilers separately, the combined configuration that you get out of the box is a better choice for most scenarios.

What is code analysis in IntelliJ?

IntelliJ IDEA analyses code in the files that are opened in the editor and highlights problematic code as you type. Additionally, you can run the necessary inspection or a set of inspections on the selected scope of files manually. In this case, you will get a comprehensive report of all problems detected in the files.

Can IntelliJ count lines of code?

IntelliJ - Line CountWe can count the line numbers in a java file using the statistics plugin or regular expression.


1 Answers

Simple way to calculate performance, please use nano second time and estimate precise time with that. i follow the below approach,

long startTime = System.nanoTime();
// TODO - Call Function Here
long endTime = System.nanoTime() - startTime;

like image 142
parrotjack Avatar answered Sep 19 '22 03:09

parrotjack