Unlock instant, AI-driven research and patent intelligence for your innovation.

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

Active Publication Date: 2019-01-18
NANJING UNIV OF SCI & TECH
View PDF5 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Windows was not designed for real-time systems at the beginning, so the time accuracy of Windows systems has not been high, and the actual minimum unit is about 15ms. As a result, all Windows time and thread-related operations cannot be accurate at 1ms control

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Implementation method of millisecond-level asynchronous timer under windows platform
  • Implementation method of millisecond-level asynchronous timer under windows platform
  • Implementation method of millisecond-level asynchronous timer under windows platform

Examples

Experimental program
Comparison scheme
Effect test

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 ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses an implementation method of a millisecond asynchronous timer in a Windows platform. A timer is obtained by calculating the main frequency of a CPU, needed timing is converted into the multiple of the clock period (the reciprocal of the main frequency) of the CPU. When the CPU continuously runs, the clock period is continuously prolonged till the set value is achieved, time is out in this way, and corresponding actions are adopted at the moment; the clock period of the CPU is nanosecond, and therefore the millisecond timer is obtained. The method achieves the advantages that millisecond is achieved under a user mode, and the millisecond asynchronous timer is accurately controlled, and the millisecond asynchronous timer is applied to a ticket vending machine system.

Description

technical field [0001] The invention belongs to the field of automatic ticket vending machine systems, in particular to a method for realizing a millisecond-level asynchronous timer on a Windows platform. Background technique [0002] The automatic ticket vending machine is the most complicated special equipment in the automatic fare collection system of the subway. Its technology involves many aspects such as machinery, electronics, software, control, finance, and radio frequency. Windows was not designed for real-time systems at the beginning, so the time accuracy of Windows systems has not been high, and the actual minimum unit is about 15ms. As a result, all Windows time and thread-related operations cannot be accurate at 1ms control. The automatic ticket vending machine system has relatively high real-time requirements, so a high-precision timer is needed to realize timing services. The communication between the automatic ticket vending machine system and related equi...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F8/20
CPCG06F8/22
Inventor 徐骏善汪惠芬柳林燕宋豪杰宋柯
Owner NANJING UNIV OF SCI & TECH