Flickering LEDs with Timer

I need your help.
The LEDs flickering correktly but it must have a timer for 10 seconds flickering and and 10 seconds off.
And repeat all.

int ledPin1 = 3; // LED Ausgang bestimmen
int ledPin2 = 5;
int ledPin3 = 9;
int ledPin4 = 11;
int val = 0; // variable LED Helligkeit
int delayval = 0; // variable LED Wartezeit

void setup() {

randomSeed(0); // Zufallszahlengenerator
pinMode(ledPin1, OUTPUT); // LED als Ausgang setzen
pinMode(ledPin2, OUTPUT);
pinMode(ledPin3, OUTPUT);
pinMode(ledPin4, OUTPUT);
}

void loop() {
val = random(0,255); // Zufallszahl zwischen 100 und 255. 0 = LED aus, 255 = LED maximale Helligkeit.
analogWrite(ledPin1, val); // Setzt das PWM Signal auf die Zufallszahl
val = random(0,255);
analogWrite(ledPin2, val);
val = random(0,255); // Zufallszahl zwischen 50 und 255. 0 = LED aus, 255 = LED maximale Helligkeit.
analogWrite(ledPin3, val);
val = random(0,255);
analogWrite(ledPin4, val);

delayval = random(30,250); // Zufallszahl zwischen 100 und 400. 50 = schnell, 600 = langsam.
delay(delayval); // Setze die Wartezeit auf die Zufallszahl

}

but it must have a timer for 10 seconds flickering and and 10 seconds off. And repeat all.

And the problem is?

Look at the blink without delay example. You should be able to figure out how to write loop that takes 10 seconds to reach the terminate condition, then use a delay(10000) to not allow loop() to iterate again for another 10 seconds.

Thank you for your help, the problem is resolved.

Link:

https://forum.arduino.cc/index.php?topic=619748.0