import ch05.queues.*; import java.util.Date; public class TimingQueues { public static final int numIterations=1000, insertsPerIteration=1000000; public static void main(String[] args) { UnboundedQueueInterfaceFloat arrayQ = new ArrayUnbndQueueFloat(); UnboundedQueueInterfaceFloat linkedQ = new LinkedUnbndQueueFloat(); // Since both queues are of the same declared type, // the same code works for both System.out.print("An array-based unbounded queue requires "); time(arrayQ); System.out.print("A linked-based unbounded queue requires "); time(linkedQ); } public static void time(UnboundedQueueInterfaceFloat queue) { long startTime, elapsedTime; Float temp; startTime = (new Date()).getTime(); // Initialized to now for (int i=0; i