试试这个:
long startTime = System.nanoTime();methodToTime();long endTime = System.nanoTime();long duration = endTime - startTime;

试试这个:
long startTime = System.nanoTime();methodToTime();long endTime = System.nanoTime();long duration = endTime - startTime;