7.GetTickCount

7.GetTickCount

原文:

The GetTickCount function retrieves the number of milliseconds that have elapsed since the system was started. It is limited to the resolution of the system timer. If you need a higher resolution timer, use a multimedia timer or a high-resolution timer.
DWORD GetTickCount(VOID)
 
Parameters
This function has no parameters.
Return Values
The return value is the number of milliseconds that have elapsed since the system was started.
Remarks
The following table describes the resolution of the system timer.
System
Resolution
Windows NT 3.5 and later
The system timer runs at approximately 10ms.
Windows NT 3.1
The system timer runs at approximately 16ms.
Windows 95 and later
The system timer runs at approximately 55ms.
 
The elapsed time is stored as a DWORD value. Therefore, the time will wrap around to zero if the system is run continuously for 49.7 days.
Windows NT: To obtain the time elapsed since the computer was started, look up the System Up Time counter in the performance data in the registry key HKEY_PERFORMANCE_DATA. The value returned is an 8-byte value.
QuickInfo
  Windows NT: Requires version 3.1 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Requires version 1.0 or later.
  Header: Declared in winbase.h.
  Import Library: Use kernel32.lib.
See Also

翻译:

GetTickCount函数获得一个以微秒计的数值,它记录了从系统开启到现在所经过的时间。它受系统分辨率的限制,如果需要高分辨率的计时器,使用multimedia timer 或high-resolution timer。
参数:无参数。
返回值:返回值是从系统启动到现在所经过的时间,以微秒计。
备注:下表描述各系统计时器的分辨率:
System
Resolution
Windows NT 3.5 and later
系统计时器分辨率约为10毫秒.
Windows NT 3.1
系统计时器分辨率约为16毫秒.
Windows 95 and later
系统计时器分辨率约为55毫秒.
经过的时间存储在双字中,49.7天后时间会再次归零。
Window NT:要获得启动后经历的时间,通过查找注册表HKEY_PERFORMANCE_DATA 项的运行数据中System Up Time计数器的一个八字节的值。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值