如何获得毫秒级的Windows系统时间? [英] How can I get the Windows system time with millisecond resolution?
本文介绍了如何获得毫秒级的Windows系统时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何获得毫秒级的Windows系统时间?
How can I get the Windows system time with millisecond resolution?
如果以上操作均不可行,那么我如何获得操作系统的启动时间?我想将此值与timeGetTime()一起使用,以便以毫秒为单位计算系统时间.
If the above is not possible, then how can I get the operating system start time? I would like to use this value together with timeGetTime() in order to compute a system time with millisecond resolution.
谢谢.
推荐答案
GetTickCount
不会为您完成.
查看QueryPerformanceFrequency
/QueryPerformanceCounter
.不过,唯一的陷阱是CPU扩展,因此您的研究也是如此.
Look into QueryPerformanceFrequency
/ QueryPerformanceCounter
. The only gotcha here is CPU scaling though, so do your research.
这篇关于如何获得毫秒级的Windows系统时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文