📅  最后修改于: 2022-03-11 14:52:20.853000             🧑  作者: Mango
long startTime = System.nanoTime();
methodToTime();
long endTime = System.nanoTime();
long duration = (endTime - startTime); //divide by 1000000 to get milliseconds.