Slowing down a message on an LED Matrix

I am trying to get a message to scroll across an LED matrix with out using delay. I have figured out how to get the message to scroll across the screen, but the message is zipping by so fast that you can not read it. I am pretty sure the problem is with my if loop and the way that I am trying to use millis() as a delay.

void loop() 
{
    unsigned long lastScrollTime = millis();

    if (lastScrollTime - millis() <= 5000)
      {
          matrix.setTextSize(1);
          matrix.setTextWrap(false);  
          matrix.setTextColor(LED_ON);
          matrix.setRotation(1);
          do{
                matrix.clear();
                matrix.setCursor(x,0);
                matrix.print("World");
                matrix.writeDisplay();
    
                x--;
             }while(x >= -36);
    
             x=7;
             lastScrollTime = millis();
          }      
        
        

      
      
      
}

Have a closer look at your first if statement.
Imagine that lastScrollTime is one millisecond ago

long lastScrollTime = millis();

Try moving that outside of loop().
And,

if (lastScrollTime - millis() <= 5000)

I think that should be millis() - lastScrollTime >= 5000. See the millis() guide.

Thanks for the help. I got it figured out. I wasn't creating a long enough interval with the way I was reading my millis(). Then when I was trying to use the do while loop, my value for x was changing to fast and it was casing the message to scroll by too fast.

Changing the code to this fixed the problem

    if (lastScrollTime - newScrollTime >= 10)
      {
         newScrollTime = lastScrollTime;
          matrix.setTextSize(1);
          matrix.setTextWrap(false);  
          matrix.setTextColor(LED_ON);
          matrix.setRotation(1);
          
          if(x >= -36)  
            {
                matrix.clear();
                matrix.setCursor(x,0);
                matrix.print("World");
                matrix.writeDisplay();
                x--;
            }else if(x < -36)
              {
                x = 7;    
              }
             

          }      
     
      
      
}