Method and device for providing relative timing in Java virtual machine

A Java virtual machine and relative timing technology, applied in the computer field, can solve the problems of early execution, repeated execution, and delayed execution of timed tasks.

Inactive Publication Date: 2014-05-28
HUAWEI TECH CO LTD
View PDF4 Cites 9 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] However, in the prior art, once the operating system time of the Java virtual machine is changed, the relative timing function in the Java virtual machine will become invalid, thus causing the timing task to be executed in advance, delayed or repeated

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
  • Method and device for providing relative timing in Java virtual machine
  • Method and device for providing relative timing in Java virtual machine
  • Method and device for providing relative timing in Java virtual machine

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0043] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

[0044] figure 1 The flow chart of Embodiment 1 of the method for providing relative timing in the Java virtual machine for the present invention, such as figure 1 As shown, the method of this embodiment may include:

[0045] Step 101, determine whether the operating system time of the Java virtual machine is changed.

[0046] Relative time...

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 embodiment of the invention provides a method and a device for providing relative timing in a Java virtual machine. The method providing the relative timing in the Java virtual machine comprises the following steps: determining whether time of an operation system of the Java virtual machine is changed or not; if so, modifying executing time of a timing task in the Java virtual machine. According to the embodiment of the invention, the time of the operation system of the Java virtual machine is determined to be changed and the executing time of the timing task in the Java virtual machine is modified after the time of the operation system is modified to realize the method providing the relative timing in the Java virtual machine; the technical problems that a relative timing function in the Java virtual machine loses the efficacy once if the time of the operation system in the Java virtual machine is changed, and the timing task is executed in advance, is delayed to be executed or is repeatedly executed can be solved.

Description

technical field [0001] The invention relates to computer technology, in particular to a method and device for providing relative timing in a Java virtual machine. Background technique [0002] Timers can be used to handle timing tasks. Timers can be divided into absolute timers and relative timers. Absolute timers execute timing tasks based on time points, and relative timers execute timing tasks based on time intervals. In practical applications, relative timers are more frequently and widely used. [0003] In the prior art, the function of pthread_cond_timedwait in C language is usually called by a function in the java.util.ScheduledThreadPoolExecutor or java.lang.Timer class library to realize the relative timing function in the Java virtual machine. [0004] However, in the prior art, once the operating system time of the Java virtual machine is changed, the relative timing function in the Java virtual machine will become invalid, thus causing the scheduled task to be ...

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/455
Inventor 童志刚
Owner HUAWEI TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products