find c++ execution time

后端 未结 6 1826
难免孤独
难免孤独 2021-01-13 09:34

I am curious if there is a build-in function in C++ for measuring the execution time? I am using Windows at the moment. In Linux it\'s pretty easy...

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-13 10:06

    C++ has no built-in functions for high-granularity measuring code execution time, you have to resort to platform-specific code. For Windows try QueryPerformanceCounter: http://msdn.microsoft.com/en-us/library/ms644904(VS.85).aspx

提交回复
热议问题