Does Windows provide a monotonically increasing cl

2020-04-02 09:11发布

问题:

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.