The Java API Calendar class contains a method called getTimeInMillisec, which enables you to retrieve the absolute
Question:
The Java API Calendar class contains a method called getTimeInMillisec, which enables you to retrieve the absolute time (in milliseconds) at which any Calendar object was created. You can use this capability to measure the runtime of any chunk of code. All you have to do is create a Calendar object before the test code starts, create another Calendar object right after the code ends, and print out the difference in those two objects’ times. You can create a Calendar object by calling the Calendar class’s static method, getInstance. For this exercise, you need to implement a class named MeasureRuntime that measures the runtime for the following statement (which displays a Charles de Gaulle quote):
Step by Step Answer:
Introduction To Programming With Java A Problem Solving Approach
ISBN: 9781260575248
3rd International Edition
Authors: John Dean