📜  java 基准测试时间 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:25.448000             🧑  作者: Mango

代码示例1
public class SomeClass{
   public void somePublicMethod()
   {
       long startTime = System.currentTimeMillis();
       someMethodWhichYouWantToProfile();
       long endTime = System.currentTimeMillis();
       System.out.println("Total execution time: " + (endTime-startTime) + "ms"); 
   }
 }