Code example for Deque

Methods: getFirst

0
		maxTimeCache.get().addFirst(Long.valueOf(System.nanoTime()));
	} 
 
	public static boolean isWithinMaxTime(double seconds) {
		long endTime = System.nanoTime();
		long startTime = maxTimeCache.get().getFirst();
		return ((double) (endTime - startTime)) / 1000000000 <= seconds;
	} 
} 
Experience pair programming with AI  Get Codota for Java