Class TimeData

Class TimeData (lines 10–20) stores two Instants representing the start and end time of a task, and provides method timeInSeconds to calculate the total time between them. We use TimeData objects throughout this example to calculate the time required to perform Fibonacci calculations.

Get Java™ How To Program (Early Objects), Tenth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.