perform if-based condition only once or multiple times?

Paul_KD7HB:
IF your program has nothing else to do, continuously writing HIGH or LOW to a pin changes nothing. For you example, you need to know when to change from writing HIGH to writing LOW.

LEDs don't care. The Arduino pin doesn't care. A relay control doesn't care.

Paul

Thanks; indeed rather simple program that just checks 2 input levels from swimming pool level sensor, so lots of delays and slow acting.

Radio amateur since 1955, 34 years of programming,..!! Wow, that makes for some experience!