Windows Time

Timers are implemented using Windows time. In Windows time, time is measured in the number of system timer ticks since Windows started. This value is stored as a 32-bit unsigned integer and wraps back to zero after Windows has been running for just over 49 days. Although improbable, this could occur between two WM_TIMER messages, for example. When comparing two times, the wrapping condition must be tested or the code may break.

Functions that use Windows time include GetTickCount, and GetMessageTime. GetTickCount returns the current number of system timer ticks. GetMessageTime returns the number of ticks when a given message was created (that is, placed in the message queue).

Get Microsoft Windows 2000 API SuperBible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.