It does something similar in Java. If you include the empty while loop it will block before the thread actually gets to the last print statement.


I suspect this has something to do with the scheduler; once the main thread gets stuck in the infinite loop, it is effectively frozen, and can no longer do anything. However since the order of operations in the C code do not directly correlate to the order of operations in the machine code, things can appear to happen out of order. So that's why we get a 0 for the millis() value on the Uno.
However if you remove the while(), we do start seeing 1's and 2's eventually for the process time, which leads me to believe the for loops are running on the order of micro seconds when we are seeing 0's.
However doing the same on the Uno still results in the same output as before, due to the different behavior from the while loop causing it to freeze.
