- 1、本文档共12页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
定时器教程.doc
Table of Contents
Introduction
Standard Win32 Timers
Multimedia Timers
Waitable Timers
Queue Timers
Conclusion
Introduction
The goal of this article is to show the practical use of different kinds of timers. First, we will see how to use the standard Win32 timers, then switch to multimedia timers, mention waitable timers and queue timers. I will try to make some general comparison between these solutions. So called high-resolution timer based on functions QueryPerformanceFrequency and QueryPerformanceCounter will not be taken into account because it can be used only to measure time intervals, and not to fire events in regular time intervals.
According to MSDN, An application uses a timer to schedule an event for a window after a specified time has elapsed. It means that if we create a timer and specify a time interval of uElapse milliseconds, it will do something every uElapse milliseconds, until we destroy it. It is up to us to specify what something is.
Timers are a useful feature offered to programmers by the OS. However, they can be easily misused: using timers for different kinds of polling (e.g. check every 200 milliseconds if the user entered some value into the edit box), is almost never a good idea. Good candidates for using timers are applications which do not depend that much on users actions, but rather on time flow.
It is important to understand that the accuracy of timers is limited. Windows is not a real-time operating system (except Windows CE) and it is not reasonable to expect timers to handle very small time intervals (10 ms, for instance).
Standard Win32 Timers
When the term timer is used, it is almost always referred to this kind of timer. I use the term Win32 timer in this article simply to make a distinction between them and other timers. In some texts, these timers are called user timers because they are not kernel objects, unlike waitable and queue timers.
How do Win32 timers work? First, we create a timer, specify its elapse time, an
您可能关注的文档
- 国家财政与地方财政的构成.doc
- 国家资助 助我成长.doc
- 国标舞服定做表--男款上衣.doc
- 国税网络发票培训相关材料_电信税务e通安全接入帐号服务协议.doc
- 国考必备 行测选词填空技巧.doc
- 国贸 操作.doc
- 国贸实习单位评价表.doc
- 国际商务单证操作习题集.doc
- 国际商法相关概念.doc
- 国际服务贸易课程论文.doc
- 场地脚手架工程施工方案(3篇).docx
- 2024年浙江省丽水市松阳县玉岩镇招聘社区工作者真题及参考答案详解一套.docx
- 2024年河南省郑州市惠济区古荥镇招聘社区工作者真题及答案详解一套.docx
- 2024年浙江省杭州市淳安县文昌镇招聘社区工作者真题及完整答案详解1套.docx
- 2024年浙江省台州市三门县小雄镇招聘社区工作者真题带答案详解.docx
- 2024年浙江省宁波市余姚市河姆渡镇招聘社区工作者真题及完整答案详解1套.docx
- 2024年浙江省丽水市景宁畲族自治县雁溪乡招聘社区工作者真题及答案详解一套.docx
- 2024年浙江省杭州市临安市板桥乡招聘社区工作者真题及答案详解一套.docx
- 2024年湖北省宜昌市点军区土城乡招聘社区工作者真题及答案详解一套.docx
- 2024年浙江省台州市路桥区桐屿街道招聘社区工作者真题附答案详解.docx
最近下载
- 鲁教版初中八年级的上册英语短语句型.docx VIP
- 新人教版高中数学选择性必修第一册全套PPT课件及配套讲义.pptx VIP
- 四川省拟任县处级试题 四川省拟任县处级党政领导干部任职资格考试题.doc VIP
- 鲁教版八年级上册英语短语句型.doc VIP
- 最新人教版(2023年新版)信息技术四年级上册(含课后反思).pdf VIP
- 2025年广东省广州市高二下学期期末考试物理(理)试卷Word版含答案 .pdf VIP
- 简单的个人简历模板.pdf VIP
- 上消化道穿孔教学查房.pptx VIP
- 科研方法论知到智慧树期末考试答案题库2025年南开大学.docx VIP
- 2023山西临汾市永和县招用公益性岗位人员50人笔试备考题库及答案解析.docx VIP
文档评论(0)