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