Microsoft KB Archive/45702

From BetaArchive Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

INFO: GetCurrentTime and GetTickCount Functions Identical

Q45702



The information in this article applies to:


  • Microsoft Win32 Software Development Kit (SDK)
  • Microsoft Windows Software Development Kit (SDK) versions 3.0, 3.1





SUMMARY

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); 

Keywords : kbKernBase
Issue type : kbinfo
Technology : kbWin32SDKSearch kbAudDeveloper kbWin3xSearch kbSDKSearch kbWin32sSearch kbWinSDKSearch kbWinSDK300 kbWinSDK310


Last Reviewed: March 5, 1999
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.