How to rewrite code in millis?
The basic pattern goes like this:
when you start the timer, you essentially store the current millisecond.
After this, in your loop code, among other things you should check if the time has passed by comparing current millisecond with the stored one. If their difference is equal or bigger of the desired delay interval, then the time has passed.
Make sure you use unsigned long variables to store times and check if time has passed with the condition used below (if(millis() - mark &gt;= interval ){...}) so you will not have problem even after millis() rolls over.
If you need more help, do not hesitate to ask.
unsigned long interval=2000; //2000ms
unsigned long mark;
boolean enabled=true;

void setup() {
    Serial.begin(9600);
    Serial.println(&quot;starting timer&quot;);
    startTimer();
    
}

void loop() {
    check();
}

void startTimer(){
    mark=millis();
}

void check(){
    if(enabled){      
        if(millis() - mark &gt;= interval ){
            
            enabled=false;
            Serial.println(&quot;time elapsed&quot;);
        }                          
        
    }
}