Does Windows provide a monotonically increasing clock to applications

拥有回忆 提交于 2019-12-19 13:46:31

问题


This question is inspired by Does Linux provide a monotonically increasing clock to applications.

Maybe I should be more precise: I'm looking for a clock function which is strictly increasing, thus never returning the same value, independant how quick two calls follow each other.


回答1:


Yes, GetTickCount() does this. If you want a higher fidelity counter, QueryPerformanceCounter is also available. Neither of these counters depend on the time of day.



来源:https://stackoverflow.com/questions/211257/does-windows-provide-a-monotonically-increasing-clock-to-applications

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!