QTextStream to console: endl and flush slow down program considerably?
-
This is mainly curiosity, but it appears that
@
QTextStream out(stdout);
out << "Test.\n"; // fast, does not flush (delayed output on console)
out << "Test." << endl; //slow, flushes and appends a newline
out << "Test.\n" << flush; //slow as above
@"Fast" being ~2.1 seconds, "slow" being ~3 seconds for a list of 6000 files. I'm guessing this has something to do with the << operator and what's going on "behind the scenes".
Question is, how do I display the message without slowing down the output?
Is there a better (=faster) way to print non-debug messages for the user?
Should I just make a --verbose switch in case the user wants to see the output?