CPU execution time in Java

前端 未结 5 1940
我寻月下人不归
我寻月下人不归 2020-12-03 03:44

I want to calculate how much CPU time my function takes to execute in Java. Currently I am doing as below.

   long startTime = System.currentTimeMillis();
           


        
5条回答
  •  臣服心动
    2020-12-03 04:16

    There are a number of profilers (Jprofile, Jprobe, Yourkit) available to analyze such data. And not only this, but much more...(such as memory utilization, thread details, etc.)

提交回复
热议问题