Android

How to Measure Elapsed Time

September 10th 2009 | Posted by msino

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.

4 Responses to “How to Measure Elapsed Time”

Leave a Reply:

You must be logged in to post a comment.