Timer
Most of the searches on Google return results for timers that schedule threads and tasks, which is not what I want.
There is always the old-fashioned way:
long startTime = System.nanoTime(); methodToTime(); long endTime = System.nanoTime(); long duration = (endTime - startTime); //divide by 1000000 to get milliseconds.
2.1m questions
2.1m answers
60 comments
57.0k users