Click to Rate and Give Feedback
MSDN
MSDN Library
Windows Development
System Services
Time
Time Reference
Time Functions
 GetTickCount64 function
GetTickCount64 function

Applies to: desktop apps | Metro style apps

Retrieves the number of milliseconds that have elapsed since the system was started.

Syntax

ULONGLONG WINAPI GetTickCount64(void);

Parameters

This function has no parameters.

Return value

The number of milliseconds.

Remarks

The resolution of the GetTickCount64 function is limited to the resolution of the system timer, which is typically in the range of 10 milliseconds to 16 milliseconds. The resolution of the GetTickCount64 function is not affected by adjustments made by the GetSystemTimeAdjustment function.

If you need a higher resolution timer, use a multimedia timer or a high-resolution timer.

To obtain the time the system has spent in the working state since it was started, use the QueryUnbiasedInterruptTime function.

Note  The QueryUnbiasedInterruptTime function produces different results on debug ("checked") builds of Windows, because the interrupt-time count and tick count are advanced by approximately 49 days. This helps to identify bugs that might not occur until the system has been running for a long time. The checked build is available to MSDN subscribers through the Microsoft Developer Network (MSDN) Web site.

To compile an application that uses this function, define _WIN32_WINNT as 0x0600 or later. For more information, see Using the Windows Headers.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

Winbase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

Time Functions
Windows Time

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
If GetTickCount is 49.7 days, how long is GetTickCount64?      Tergiver   |   Edit   |   Show History
It's ~585 million years.
Tags What's this?: Add a tag
Flag as ContentBug
GetTickCount64 is in milliseconds, not ticks      vcsjones ... Thomas Lee   |   Edit   |   Show History
Despite the name, it returns the number of milliseconds of uptime, not ticks.
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker