private void printTime() throws InterruptedException {
            //add your code here - добавь код тут

            while (!isStopped){
               Thread.sleep(1000);
                seconds++;
                if (seconds == 60){
                    seconds = 0;
                    minutes++;
                    if (minutes == 60){
                        minutes = 0;
                        hours++;
                        if (hours == 24){
                            hours = 0;
                        }
                    }
                }
                if (hours == 0 && minutes == 0 && seconds == 0) {
                    System.out.println(String.format("В г. %s сейчас полночь!", cityName));
                } else {
                    System.out.println(String.format("В г. %s сейчас %d:%d:%d!", cityName, hours, minutes, seconds));
                }
            }
        }
В IDEA код работает. Ответ один в один с условием! При валидации "Программа работала слишком долго и была закрыта!"