A “while (true);” in your loop() function is at the very least unconventional!
What happens if you remove it? I would hope you’ll get the same output messages repeated continuously.
If you do, then that loop is probably preventing an output buffer from being flushed.
Or, you might try inserting “Serial.flush();” before it.