How to turn on 3 relay simultaneously?

I'm used 3 relay and need to turn on at the same one, can help me?? the code below. with thanks for all
int relayPin = 3;
int relayPin1 = 7;
void setup() {
Serial.begin(9600);
pinMode(relayPin, OUTPUT);
digitalWrite(relayPin, LOW);
pinMode(relayPin1, OUTPUT);
digitalWrite(relayPin1, LOW);
}

void loop() {

digitalWrite(relayPin, HIGH);
digitalWrite(relayPin1, HIGH);
delay(500);
digitalWrite(relayPin, LOW);
delay(1000);
digitalWrite(relayPin1, LOW);
delay(1000);

}

That code does something, what is it doing and what is different than what you want. Can you post data on the relays? How are the relays driven? An Arduino can't directly drive most relays. Does your driver have a kickback (freewheel) diode? Post a schematic of your setup. I see only 2 relays in the code?

Please read the "how to use the forum" stickies to see how to format and post code and for information on what we need to be able to help you.

If you want things to happen "simultaneously", just take out the delays between them.

Well for a start your code only has 2 relays not 3, but these lines turn them both on at essentially the same time, so I'm not really sure what your question is.

 digitalWrite(relayPin, HIGH);
 digitalWrite(relayPin1, HIGH);

You can't get them any more "simultaneous" than consecutive lines of code.

(Presumably you know how to add the necessary lines for the 3rd relay?)

You can't get them any more "simultaneous" than consecutive lines of code.

Actually you can using PORT manipulation

J-M-L:
Actually you can using PORT manipulation

Yeah that's true, I forgot about that. But I wonder if it has any practical significance to the OP.

Attach all three relays to the same pin on your relay driver.

You are using a relay driver module?

PaulMurrayCbr:
Attach all three relays to the same pin on your relay driver.

Looks like he wants to off them at different times though.