I know how to profile methods in netbeans to see which one is taking the most time, but I wonder if there is a way to find which line of statements in that method is responsible for that.
            Asked
            
        
        
            Active
            
        
            Viewed 110 times
        
    0
            
            
        - 
                    1possible duplicate of [How do I write a correct micro-benchmark in Java?](http://stackoverflow.com/questions/504103/how-do-i-write-a-correct-micro-benchmark-in-java) – DavidPostill Aug 19 '14 at 10:11
- 
                    1There's a bone-simple way to find that out. [*Look here.*](http://stackoverflow.com/a/317160/23771) – Mike Dunlavey Aug 20 '14 at 11:18
1 Answers
0
            Best commercial tools you can use (with a 30 days trial) is Yourkit java profiler which lets you know lots of details about your code , slow methods,dead locks,.... There a also some other profilers like Jprofiler which I did not use personally and as free,easy to use you can take a look at java visualvm which comes with JDK 6 and higher.
 
    
    
        M2je
        
- 127
- 6
- 
                    Yourkit seems to be very fast, but still it doesn't provide the analysis over statements. I get some stats on methods, but nothing for the statements. – user3639557 Aug 19 '14 at 02:52
- 
                    
- 
                    If you mean SQL statement take a look at this http://www.yourkit.com/docs/80/help/cpu_j2ee.jsp – M2je Aug 19 '14 at 03:08
