public class TestRunTime1{ abstract void run(); public void test(){ long startTime=System.nanoTime(); //开始计时 run(); long endTime=System.nanoTime();//停止计时 System.out.printf("运行时间为:%dns%n",(endTime-startTime)); }}
public class TestRunTime1{ abstract void run(); public void test(){ long startTime=System.nanoTime(); //开始计时 run(); long endTime=System.nanoTime();//停止计时 System.out.printf("运行时间为:%dns%n",(endTime-startTime)); }}
发布时间:2025-08-19 08:15:38