未分类--Windows API--GetTickCount

原文来自MSDN Library for Visual Studio 2008 SP1,翻译部分仅为个人观点,想要看更多信息请看MSDN,如有版权问题请联系QQ 643166601,邮件[email protected]

 

GetTickCount Function

Retrieves the number of milliseconds that have elapsed since the system was started, up to 49.7 days.
取回从系统启动开始经过的毫秒数,上线是49.7天。

Syntax
DWORD WINAPI GetTickCount(void);

Parameters
This function has no parameters.
这个函数没有参数。
Return Value
The return value is the number of milliseconds that have elapsed since the system was started.
返回值是从系统启动开始经过的毫秒数。
Remarks
The resolution is limited to the resolution of the system timer.
这个分辨率被限制由系统的计时器分辨率。
This value is also affected by adjustments made by the GetSystemTimeAdjustment function.
这个值也受GetSystemTimeAdjustment函数调整的影响。
The elapsed time is stored as a DWORD value.
这个经过的时间是一个DWORD值存储的。
Therefore, the time will wrap around to zero if the system is run continuously for 49.7 days.
因此,如果系统连续不断的运行49.7天后这个时间将返回到0。
To avoid this problem, use GetTickCount64.
为了避免这个问题,使用GetTickCount64。
Otherwise, check for an overflow condition when comparing times.
否则,检查溢出的比较时间条件。
If you need a higher resolution timer, use a multimedia timer or a high-resolution timer.
如果你需要一个更高的分辨率计时器,使用多媒体计时器或高分辨率计时器。
To obtain the time elapsed since the computer was started, retrieve the System Up Time counter in the performance data in the registry key HKEY_PERFORMANCE_DATA.
去获得从头电脑启动经过的时间,取回在注册表HKEY_PERFORMANCE_DATA中的性能数据中的系统运行时间计数器。
The value returned is an 8-byte value.
这个值是一个8位值。
For more information, see Performance Counters.
更多信息,请看Performance Counters。

Requirements
Client Requires Windows Vista, Windows XP, or Windows 2000 Professional.
Server Requires Windows Server 2008, Windows Server 2003, or Windows 2000 Server.
Header Declared in Winbase.h; include Windows.h.
 
Library Use Kernel32.lib.
 
DLL Requires Kernel32.dll.
 

See Also
Time Functions

 

Send comments about this topic to Microsoft

Build date: 4/24/2008

 

你可能感兴趣的:(windows,api)