class TimerLogic implements RunnableService {

	public Timer pauseTimer(Timer timer) {
		if (timer.isActive()) {
			this.timerbeep.stopBeep(timer);
			timer.setActive(false);

			LocalDateTime current = LocalDateTime.now();
			LocalDateTime future = timer.getTimerTime();
			timer.duration(Duration.ofMillis(current.until(future, ChronoUnit.MILLIS)));
			this.timerStorage.save(timer);
			return timer;
		}
		throw new IllegalArgumentException("Timer is already inactive");
	}

}