加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

delphi – TTimer的准确度如何?

发布时间:2020-12-15 09:21:16 所属栏目:大数据 来源:网络整理
导读:当我将TTimer间隔设置为1时,它实际上是每1毫秒执行一次代码还是每隔20毫秒或者其他什么? 我问这个问题,因为我知道Windows API Sleep()函数不准确,所以我想知道它是否与TTimer相同. 解决方法 The standard VCL TTimer component is a wrapper for the Window
当我将TTimer间隔设置为1时,它实际上是每1毫秒执行一次代码还是每隔20毫秒或者其他什么?

我问这个问题,因为我知道Windows API Sleep()函数不准确,所以我想知道它是否与TTimer相同.

解决方法

The standard VCL TTimer component is a wrapper for the Windows API timer functions SetTimer and KillTimer. TTimer simplifies the processing of the WM_TIMER messages by converting them into OnTimer events. A timer based on WM_TIMER message processing cannot provide a resolution better than 10 milliseconds.

Source: Sergworks

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读