printf more than 5 times faster than std::cout?

后端 未结 6 896
遇见更好的自我
遇见更好的自我 2020-12-09 10:44
#include 
#include 
#include 
#include 

int main(int argc, char* argv[])
{
    std::clock_t start;
    dou         


        
6条回答
  •  无人及你
    2020-12-09 11:14

    I only have a programming range of 1 computer, so not much testing. Anyhow, std::cout is way more faster on my build using the exact verbose code. I am using Cpp14.

    I just think certain people have a pick for C++. Yes C is great language but logically I don't see how printf can be faster than std cout. Printf has to do type conversions from void pointer on runtime. Cout does that at compile time.

提交回复
热议问题