本文已被:浏览 1474次 下载 5675次
Received:January 18, 2013 Revised:March 08, 2013
Received:January 18, 2013 Revised:March 08, 2013
中文摘要: 介绍一种在BCB开发环境基于多线程的高精度定时器类的设计实现. 由VCL组件库中的TThread派生类结合Windows消息机制设计了实测误差<0.5ms的定时器类, 该类具有单实例-多定时器管理、线程工作状态可控、回调方式可控等优点, 宜用性及可定制性均优于普遍采用的系统定时器及多媒体定时器, 可在工业控制、多媒体应用设计、实时信号采集与处理等领域得到应用.
中文关键词: C++ Builder IDE Windows 定时器 多线程 线程优先级 Windows消息机制 定时精度 实时性
Abstract:This paper present a realization of hi-resolution timer class, based on multithread technique, in the BCB IDE. Utilizing of the class, derived from TThread class of VCL and integrated with Windows message mechanism, achieved a general timing-error < 0.5ms. The class is provided of advantages such as multiple timers-single object managing, work state of timer-thread adjusting, callback mode controlling, as well as more convenient and more customizable than traditional windows System Timer and Multimedia Timer. Thus it could be applied in projects with relatively time-critical requirement, e.g. industrial control, multimedia app development and realtime signal sampling & processing.
keywords: C++ Builder IDE Windows timer multithread thread priority message mechanism timing precision real-time
文章编号: 中图分类号: 文献标志码:
基金项目:国家自然科学基金青年项目(81202178/H2602);全军医药卫生重大项目(AWS12J003)
引用文本:
李晓京,张利利,胡文东,文治洪,马进.C++ Builder中高精度定时器管理类设计及其应用.计算机系统应用,2013,22(8):145-150,201
LI Xiao-Jing,ZHANG Li-Li,HU Wen-Dong,WEN Zhi-Hong,MA Jin.Design and Application of High Resolution Timer Managing Class in C++Builder IDE.COMPUTER SYSTEMS APPLICATIONS,2013,22(8):145-150,201
李晓京,张利利,胡文东,文治洪,马进.C++ Builder中高精度定时器管理类设计及其应用.计算机系统应用,2013,22(8):145-150,201
LI Xiao-Jing,ZHANG Li-Li,HU Wen-Dong,WEN Zhi-Hong,MA Jin.Design and Application of High Resolution Timer Managing Class in C++Builder IDE.COMPUTER SYSTEMS APPLICATIONS,2013,22(8):145-150,201