Measuring Java execution time, memory usage and CPU load for a code segment

后端 未结 4 474
温柔的废话
温柔的废话 2020-12-04 19:36

For a particular segment of Java code, I\'d like to measure:

  • Execution time (most likely thread execution time)
4条回答
  •  一向
    一向 (楼主)
    2020-12-04 20:20

    Using a Java Profiler is the best option and it will give you all the insight that you need into the code. viz Response Times, Thread CallTraces, Memory Utilisations, etc

    I will suggest you JENSOR, an open source Java Profiler, for its ease-of-use and low overheads on CPU. You can download it, instrument the code and will get all the info you need about your code.

    You can download it from: http://jensor.sourceforge.net/

提交回复
热议问题