Implementation method of millisecond-level asynchronous timer under windows platform
An implementation method and timer technology, applied in the direction of software design, etc., can solve the problems of inaccurate control and low time precision of Windows system, and achieve the effect of meeting real-time requirements, small error, and reducing timing error
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment Construction
[0013] The invention realizes the timer by calculating the main frequency of the CPU, and converts the required timing into a multiple of the CPU clock period (reciprocal of the main frequency). When the CPU is running continuously, its clock cycle is continuously increasing until it reaches the set value, so that it times out, and the corresponding action is taken at this time; and the CPU clock cycle is at the nanosecond level, so the implementation of the millisecond-level timer is realized.
[0014] The implementation method of the millisecond-level asynchronous timer under the Windows platform of the present invention includes
[0015] 1.1 Realize the timer:
[0016] ■Each timer class object contains: timer ID, timing interval, life time, timing callback function, timeout value, automatic reset flag, callback flag and thread information.
[0017] ■ Each timer contains corresponding methods. These methods set the timeout value, make a callback in a thread, terminate the ...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


