Total method time in Java VisualVM

前端 未结 7 897
野趣味
野趣味 2020-12-04 21:09

In Java VisualVM, is there any way to display total method time, rather than \"self time\"? (The latter is not particularly useful, since it doesn\'t tell you anything about

7条回答
  •  鱼传尺愫
    2020-12-04 21:45

    you could use a

     long startTime = System.currentTimeMillis();
    

    at the beggining

    and

     long endTime = System.currentTimeMillis();
    

    and finally to get the result

     long result = endTime - startTime; //Note, part might be backwards, I don't
                                        //Remember
    

提交回复
热议问题