Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Timing method and device

A timing and timer technology, applied in the computer field, can solve problems such as the complexity of development programs, the high cost of timer time, and the difficulty of program maintenance, so as to achieve the effects of reducing complexity, reducing maintenance difficulty, and simplifying use

Active Publication Date: 2017-05-31
WUHAN DOUYU NETWORK TECH CO LTD
View PDF6 Cites 5 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] Due to the wide variety of timers provided by the Android system, developers need to spend a lot of time learning and mastering the use of various timers before using the timers, resulting in a high time cost for flexible use of timers
The use of multiple timers also leads to the complexity of the development program, making the developer's handling of the timer complex and changeable when developing the program, and as the number of timers used in the program increases, the difficulty of program maintenance increases

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
  • Timing method and device
  • Timing method and device
  • Timing method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0047] An embodiment of the present invention provides a timing method.

[0048] During Android development, timers are often used. There are roughly four types of timers provided by Android:

[0049](1), using the timing method of the Handler (processor) and the sleep function sleep() of the thread

[0050] Handler is a class used for communication between the main thread and sub-threads. It can open a sub-thread, execute the sleep function sleep() in the sub-thread, and notify the main thread through the Handler that the timer times out after the sleep time is completed.

[0051] When using this timer, you can adjust the timing length by adjusting the sleep time of the sleep function sleep(), so as to realize the timing function. However, if the sleep time is too long, it may cause a memory leak, resulting in the inability to release part of the memory of the application. In addition, when the system enters the dormant state, the timer cannot execute the timing task becau...

Embodiment 2

[0092] see Figure 4 , an embodiment of the present invention provides a timing device, configured to implement the timing method provided in Embodiment 1 above. Specifically, the device includes:

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 provides a timing method and device. The method includes the following steps that when a program starts to run, whether a timer function is contained in the program is detected in real time; when it is detected that the timer function is contained in the program, according to the type parameter carried by the timer function, the timing type to which a current timing task belongs is determined; according to the timing parameter carried by the timer function, the current task is executed by adopting a timing mode corresponding to the timing type. According to the timing method and device, common Android timers are divided into two timing types, namely a short-period timing type and a long-period timing type; developers do not need to master the use methods of various timers, just need to make it clear whether the short-period timing or the long-period timing is needed, and then well set the type parameter and timing parameter of the timer function; when the program starts to run, the timing type is automatically determined according to the type parameter of the timer function, the timing mode corresponding to the timing type is adopted, the use of the timer is simplified for the developers, the complexity of application development is reduced, and the difficulty of program maintenance is reduced.

Description

technical field [0001] The present invention relates to the field of computer technology, in particular to a timing method and device. Background technique [0002] At present, developers often use timers in the process of Android development, and the Android system provides various timers. For example, the timer using the Handler (manager) and the sleep (sleep) method of the thread, the timer using the postDelayed (delay) method of the Handler, and the combination method of Handler and timer (timer) and TimerTask (timer task) Timer, and AlarmManager (global timer), etc. [0003] Due to the wide variety of timers provided by the Android system, developers need to spend a lot of time learning and mastering the use of various timers before using the timers, resulting in a high time cost for flexible use of timers. The use of multiple timers also leads to the complexity of the development program, making the developer's handling of the timer complex and changeable when develo...

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
IPC IPC(8): G06F9/44
CPCG06F8/22
Inventor 张磊
Owner WUHAN DOUYU NETWORK TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products