开发者

Is QueryPerformanceCounter guaranteed to give you time since boot?

开发者 https://www.devze.com 2023-04-05 07:34 出处:网络
Is it safe to assume that the count returned from Q开发者_C百科ueryPerformanceCounter relates to the time since the last system boot? Or could it be reset while the system is running? The MSDN article

Is it safe to assume that the count returned from Q开发者_C百科ueryPerformanceCounter relates to the time since the last system boot? Or could it be reset while the system is running? The MSDN article itself doesn't guarantee this, however I've seen some 3rd party information (such as this) that says that this is the case.


It's meant to be used for relative times. But I don't think it can be used to measure time since boot.

From what I hear, it's implemented using the rdtsc instruction which measures "pseudo" CPU cycles since the CPU was powered on. In that case, yes, it probably does give the time since boot, but I don't think this is specified.

0

精彩评论

暂无评论...
验证码 换一张
取 消