In this case it is.
But If I'm making a huge program, much heavier than this, which uses a lot of memory and resources... well, what's the deal with this?
On one hand I get a very fast program, and on the other a rusted wagon?
But If I'm making a huge program, much heavier than this, which uses a lot of memory and resources... well, what's the deal with this?
Then I doubt your use cases will resemble anything at all like empty loops.
On one hand I get a very fast program, and on the other a rusted wagon?
Unless you're compiling with optimizations on, you can draw no conclusions from your observations, and as demonstrated with the links above, the timing is identical with similar optimization settings.
Perhaps you should spend some time getting familiar with your optimization settings.
You might not be timing anything at all. Since neither function does anything and the compiler can see that, it's entirely possible that the compiler optimized away the call altogether.
Try putting the definition of f() and f2() in a separate compilation unit to force the program to actually make the call.