C++ Cross-Platform High-Resolution Timer
Updated answer for an old question: In C++11 you can portably get to the highest resolution timer with: #include <iostream> #include <chrono> #include “chrono_io” int main() { typedef std::chrono::high_resolution_clock Clock; auto t1 = Clock::now(); auto t2 = Clock::now(); std::cout << t2-t1 << ‘\n’; } Example output: 74 nanoseconds “chrono_io” is an extension to ease I/O … Read more