JAVA学习笔记

xiaoxiao2021-02-28  33

方法一:

Date start = new Date(); ... ... ... Date end = new Date(); System.err.println("运行时间: "+(end-start)+"ms")

方法二:

long startTime=System.currentTimeMillis(); ... ... ... long endTime=System.currentTimeMillis(); System.err.println("运行时间: "+(end-start)+"ms");

方法三:

long startTime=System.nanoTime(); ... ... ... long endTime=System.nanoTime(); System.err.println("运行时间: "+(end-start)+"ms");
转载请注明原文地址: https://www.6miu.com/read-2630589.html

最新回复(0)