Why is .NET faster than C++ in this case?

后端 未结 13 1470
长发绾君心
长发绾君心 2021-02-02 00:59

Make sure you run outside of the IDE. That is key.

-edit- I LOVE SLaks comment. \"The amount of misinformation in these answers is staggering.\" :D

13条回答
  •  北恋
    北恋 (楼主)
    2021-02-02 01:27

    I think the problem is your timing code in C++.

    From the MS docs for __rdtsc:

    Generates the rdtsc instruction, which returns the processor time stamp. The processor time stamp records the number of clock cycles since the last reset.

    Perhaps try GetTickCount().

提交回复
热议问题