📜  java 获取执行时间 - Java 代码示例

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

代码示例1
long startTime = System.nanoTime();
methodToTime();
long endTime = System.nanoTime();

long duration = (endTime - startTime);  //divide by 1000000 to get milliseconds.