GetCurrentTime and GetTickCount Functions IdenticalLast reviewed: November 2, 1995Article ID: Q45702 |
The information in this article applies to:
The GetCurrentTime() and GetTickCount() functions are identical. Each returns the number of milliseconds (+/- 55 milliseconds) since the user started Windows, and the return value of each function is declared to be a DWORD. The following code demonstrates these two functions:
DWORD dwCurrTime;
DWORD dwTickCount;
char szCurrTime[50];
dwCurrTime = GetCurrentTime ();
dwTickCount = GetTickCount ();
sprintf (szCurrTime, "Current time = %lu\nTick count = %lu",
dwCurrTime, dwTickCount);
MessageBox (hWnd, szCurrTime, "Times", MB_OK);
NOTE: GetCurrentTime() and GetTickCount() return an unsigned double word
(32-bit DWORD) which gives a maximum count of 4,294,967,296 ticks. This
number will yield a maximum count of 49.71 days which the system keeps
track of running time.
|
Additional reference words: 3.00 3.10 3.50 3.51 4.00 95
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |