Answer the question
In order to leave comments, you need to log in
How to evaluate code execution speed in Intellij Idea?
Colleagues, hello!
Tell me, if there is some built-in functionality in Intellij Idea to check how fast the code or section of code is executed?
I’m still learning only and I immediately want to understand which method of solving a particular problem will be more effective.
Answer the question
In order to leave comments, you need to log in
There are two system methods:
System.nanoTime(); //величина текущего времени в наносекундах
System.currentTimeMillis(); //величина текущего времени в милисекундах
long startTime = System.currentTimeMillis();
{
//какой- то код, скорость работы которого нужно оценить
}
//время затраченное на выполнение кода
long time = System.currentTimeMillis() - startTime;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question