Perhaps this is kind of obvious, but I only realized this today. When I'm hacking on a piece of code containing a large for-loop in some algorithm, I'm often printing the current iteration to the console to keep a tab on the progress.
Consider this trivial example:
This outputs a fast scrolling list of integers so I can keep track of progress, but this results in the following running time on the console:
$ time python print_time.py ... ... 16777215 real 11m5.059s user 1m16.077s sys 1m8.568s
Running the same code without the
$ time python print_time.py real 0m13.585s user 0m13.569s sys 0m0.008s
It's not because of the performance of the