turn on and off a led

Hello I am zero in arduino programming. Help me to program lightening and extinction every 10 minutes' of a ed on arduino.If .comthe current cuts at the end 6 minutes ,i want the led to run still 4 minutes after the current is restored before stopping.
i found this programin arduino
How can i complete it ?

// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(10000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(10000); // wait for a second
}

If you want to remember stuff across a power-down-power-up, then you'll need to store information in
the on-chip EEProm, for which there is a basic library EEPROM, and some other stuff built on that
for storing more than just unstructured bytes.

However writing to the EEPROM wears it out, perhaps 100 thousand writes limit, so you have to be
wary of writing to it frequently. If you were to write the number of minutes left to go every minute, then
at restart you'd continue from where you'd left off, until the count reduced to zero.

Along the lines of MarkT's post, you could purchase additional hardware and add an SD card to write your info to. Regardless of the method, you'll need to store the info some way to accomplish your goal.

And a side note, delay(10000) is "//wait 10 seconds". And not "//wait for a second".

samirango:
.If .comthe current cuts at the end 6 minutes ,i want the led to run still 4 minutes after the current is restored before stopping.

That seems a very strange requirement.

As written it suggests to me that an LED might be intended to stay lighting for 10 minutes but some person disconnects the Arduino from the power before the 10 minutes has completed. Then, when power is restored (maybe a few days later?) it should continue to light the LED for the unused part of the 10 minutes.

I wonder if you have correctly expressed what you want to happen? Or maybe your real application does not involve an LED at all. If so tell us what you are really trying to do.

...R