private void restartAnimation() {
		timer.start();
		paintCounter = MAGIC_TIMER_CALLS_WITHOUT_PAINT_CALL;
	}
best guess at how many timer invocations may happen before paint gets called
Ghidra/Framework/Docking/src/main/java/docking/util/AnimatedIcon.java