How to Measure Elapsed Time


Many applications have to measure time intervals. Android has lots of SystemClock APIs and initially it might be confusing what to use. To measure elapsed time you can use…

System.nanoTime();

An elapsed time timer just calls this twice and subtracts the end time from the start time.

The boom-mobile source code has a great StopWatch class that you can use as a basis of a timer.

Comments are closed.