'is it possible to using jstack to print the the method each line of code execute time

Today I facing a problem that the spring boot(Java 8) production one methond execute takes a long time. I only have the jdk tools in production environment. Is it possible to print the java method execute time of each line of code so that I could know which line take the longest time. I have tried using jstack and jmap but it seems could not work like this, I have read my source code and still did not figure out which line cause this problem. what should I do to print the execute time of each line of code in the production method code? is it possible to do like this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source