4 ms·
Strictly speaking yes (or the "C++ version" could replace std::endl with \n), but the observable behavior isn't going to change much. The runtime is going to fl
by jonathrg 4y ago
Strictly speaking yes (or the "C++ version" could replace std::endl with \n), but the observable behavior isn't going to change much. The runtime is going to flush the output buffer at program exit anyway.
- charcircuit 4y agoBut couldn't it effect the observable behaviour of the time it takes to execute?
- jonathrg 4y agoThat's not really what I mean (I meant that it's not going to result in any difference in which system calls are made etc). If you flush manually, the runtime-provided routine that closes all streams (see e.g. https://www.gnu.org/software/libc/manual/html_node/Normal-Termination.html https://www.gnu.org/software/libc/manual/html_node/Normal-Te...) will just do nothing, so you get a little bit of overhead from that