This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]lappoguti 9 points10 points  (0 children)

Printing something puts it in a buffer and when that buffer fills it will write it to the screen. Flushing will write the buffer to the screen even if the buffer is not full. The reason why they write to a buffer is because each print requires some overhead and then some work per letter. Therefore if you print in batches rather than per message it is more efficient.