If you print without "\n", the msg is not neccessary to show up on screen at the time you expected. It will show up when one of those happened:
- The output buffer is full
- a later print statement contains \n
- the program finished
If you don't want to wait:
- end your msg with "\n"
- at the beginning of your code: $| ++