Recipe 6.12. Measuring Elapsed Time
6.13.1. Problem
You need to time how long it takes to do something.
6.13.2. Solution
Call System.currentTimeMillis(
)
twice, or System.nanoTime(
)
, and subtract the first result from the second
result.
You are currently reading a PREVIEW of this book.
Get instant access to over
$1 million worth of books and videos.
Start a Free Trial