C Principle

i got a little question...

when i writing a code in the void loop() function if 2 IF conditions are correct in the same time, are they will execute together?
for example:

void setup()
{

    time_t StartRuningTime = now();

}



void loop()
{   
    time_t t = now();


if(LimitSwitch == HIGH) {DrainCleanFLAG = 1;}
   
 
if(DrainCleanFLAG == 1) 
{ 

       digitalWrite(TankDrainValve, HIGH); 
       delay(10000); 
       digitalWrite(TankDrainValve, LOW); 
       delay(250); 
       DrainCleanFLAG = 1;
}




if(month(t) -  month(StartRuningTime) ==  0) 
{ 
       if(hour(t) >= 6 && hour(t) <= 0) { digitalWrite(HpsLamp, HIGH);} 
       else { digitalWrite(HpsLamp, LOW); } 
    
}

thanks for the helpers

when i writing a code in the void loop() function if 2 IF conditions are correct in the same time, are they will execute together?

If by together you mean "at the same time", the answer is no.

You need to have a look at the BlinkWithoutDelay example.

no, the code is executed from top to bottom of the function, one instruction at time.
normally the code is so fast that SEEM executed at the same time (we are talking about 16.000.000 instruction at seconds in arduino)

multitasking on monocpu and monocore system work with this principle

real parallelism can be archived only in multicore/multiprocessor system, using one process or thread per core

if you are simply asking if it will execute the section code of the 2 if, yes if the conditions are true and the if aren't in the else section