Code about millis() don't undersand

Hello guys. I saw this code in a bood, and I really don't get how the void loop() part works, here is the code:

// Project 5 - LED Chase Effect
byte ledPin[] = {4, 5, 6, 7, 8, 9, 10, 11, 12, 13}; // Create array for LED pins
int ledDelay(65); // delay between changes
int direction = 1;
int currentLED = 0;
unsigned long changeTime;
void setup() {
for (int x=0; x<10; x++) { // set all pins to output
pinMode(ledPin[x], OUTPUT); }
changeTime = millis();
}
void loop() {
if ((millis() - changeTime) > ledDelay) { // if it has been ledDelay ms since
last change
changeLED();
changeTime = millis();
}
}
void changeLED() {
for (int x=0; x<10; x++) { // turn off all LED's
digitalWrite(ledPin[x], LOW);
}
digitalWrite(ledPin[currentLED], HIGH); // turn on the current LED
currentLED += direction; // increment by the direction value
// change direction if we reach the end
if (currentLED == 9) {direction = -1;}
if (currentLED == 0) {direction = 1;}
}

what does this "changeTime = millis();" mean? Tell changeTime how long the LED has been lighting? if yes, how to explain the rest?

Thank you very much.

millis() is like a free running counter that starts from 0 when reset occurs.
so
changeTime = millis();
says to make changeTime have the current value of the millis count.

So when the ledDelay time has passed, the LED state changes and changeTime is updated to the current counter for the next ledDelay interval.

Here is a more verbose explination:

millis() returns the number of milliseconds since the system started.
When the millis() value is stored in a variable (such as changeTime) then you can determine elapsed time by subtracting the stored millis value from the current millis() value: millis() – changedTime is equal to the elapsed milliseconds

so millis() - changeTime) > ledDelay is checking if the elapsed milliseconds since the changeTime value was stored is greater than the ledDelay value.

BTW, posts with code are easier to read if you use the ‘insert code’ button (the one with the #) and place your code between the tokens.

Ok I see. Thank you guys.