public synchronized void setDuration(Duration duration) {
		if (duration.isZero() || duration.isNegative()) {
			throw new IllegalArgumentException("The duration must be a time > 0!");
		}

		this.lifetime = duration.toMillis();
		if (timerMonitor != null) {
			timerMonitor.cancel();
			timerMonitor = null;
		}
		timerExpired();// this will purge any older values and reset the timer to the correct delay
	}
Sets the duration for keeping cached values.
@param duration the length of time to keep a cached value
Ghidra/Framework/Generic/src/main/java/ghidra/util/timer/GTimerCache.java