You quoted my whole post, except the sentences containing questionmarks, "I might be wrong", and "Theoretically". Notice that I was only asking, not claiming.
If the loop sets current time into setup every 10 seconds
This doesn't make sense. The loop() function should not call setup(). Without an RTC or PC, the "current time" is maintained by adding to a known time as the crystal ticks off time. The crystal is not terrible accurate, though.
Really? Can you not at all imagine that a complete rookie was thinking there might be a way to change values in setup()?
Tbh, I still don't understand why that is not possible. Would be quite handy.
that should keep the time going even if the board restarts.
No. The Arduino stops, and all data that it has is lost. Without a new baseline "current time", the "current time" will not be the current time.
All data is lost? When I disconnect my Arduino, and connect it back in, the same program is running. It's not lost at all. Only the temporary data is lost, therefor handy to change the setup(), so that we could set the current time into setup() every 10 seconds. If there is an error to the board that makes it restart, this would be fine, and the clock would keep counting, being 10~seconds off.
Of course, if the board is without electricity for a while, this will fail.
As long as you define "for a while" to be a few nanoseconds or more, I'll agree with you. If you think that "for a while" means any measurable time, I'll have to disagree.
A bit of a small issue, but I don't understand why you keep saying agree and disagree. I was simply askin, so how can you agree or even disagree with me..?
To answer your "question"; when I suggested it would fail without electricity for a while, this was considering that the setup() was changeable(remember, I was asking if it was). If it would be without electricity for "a while", it would still kindof work, except that the time would be "a while" off. Again, considering the setup() was changeable. I was asking that.
OnTopic: Asking everyone now. In example, setup() says that x = 1. Is there any way a loop-code could change this, so that when the board restarts, x would be for example 0? Without the loop() changing x directly. Does this make sense?