Robin2:
The whole purpose of using millis() instead of delay() is to replace blocking code with non-blocking code.
The inherent and actual purpose of the millis() function is known to the veteran; but, not to the OP (a beginner) as I can say from my experience; your experience could be different. Allowing a LED to remain ON for 1-sec time and then looking around within that 1-sec time to see if there is anything to do while checking if the said 1-sec time is over -- a non-blocking concept that can only be visualized by a veteran.
150 senior level pupils were given the following task; unfortunately, none of them could come up with correct solution within 50 minutes of the period and yet, there are students among them who will become teachers of the institute after graduation!
"Create sketch so that the L (built-in LED of UNO) of the following circuit remains ON for 1-sec time as long as the button K1 remains at open condition."
Edited diagram in response to the reaction of Post#21.
GolamMostafa:
The OP has not asked for non-blocking codes. Probably, he has wished to get familiar with the usage of millis() function.
UKHeliBob:
At least, not yet
Seems he has now... not in as many words, but needs a button to "immediately" (his word) turn the current led off.
So yeah "well done" to AKRF and GolamMostafa for effectively putting the OP back 3 weeks. He now needs to re-jig the sketch he had to accommodate the immediacy of the button.