Is QueryPerformanceCounter guaranteed to give you time since boot?
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.
精彩评论