Mr.C64
Mr.C64

Reputation: 42924

C++ cross-platform equivalent of Windows' QueryPerformanceCounter()

To measure the execution time of some portion of C++ code on Windows, I tend to use the QueryPerformanceCounter() high-resolution timer. An example of that can be found in this VCblog post on STL performance.

With the aim of writing cross platform C++ code, what functions/classes could I use for that same purpose?

Upvotes: 2

Views: 1641

Answers (1)

Stack Overflow is garbage
Stack Overflow is garbage

Reputation: 247949

Assuming a modern compiler, you're probably looking for std::chrono::high_resolution_clock

Upvotes: 6

Related Questions