Learn how to measure intervals of time in Java. Understand when to use the Period class for date-based intervals and Duration for time-based intervals.