C++ Cross-Platform High-Resolution Timer

前端 未结 14 2328
不知归路
不知归路 2020-11-22 12:45

I\'m looking to implement a simple timer mechanism in C++. The code should work in Windows and Linux. The resolution should be as precise as possible (at least millisecond a

14条回答
  •  一向
    一向 (楼主)
    2020-11-22 13:47

    SDL2 has an excellent cross-platform high-resolution timer. If however you need sub-millisecond accuracy, I wrote a very small cross-platform timer library here. It is compatible with both C++03 and C++11/higher versions of C++.

提交回复
热议问题