Discover timer with multiple alarms, include the articles, news, trends, analysis and practical advice about timer with multiple alarms on alibabacloud.com
Spring MVC implements multiple timer tasks in a timer class1. Create a new timer configuration file, called Spring-task.xml, which reads as follows:Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance" xmlns:context= "Http://www.springframework.org/schema/context"Xmlns:mvc= "Http://www.springframework.org/schema/mvc"
Spring4 multiple timer details, spring4 timer details
Note: spring4 does not have the org. springframework. scheduling. timer. ScheduledTimerTask class, so the timerTask method before spring3 cannot be used. Two methods are recommended for the spring4 timer method: (you need
multiple scheduled tasks, where there are two problems, one being that the virtual timer activates after the next hardware timer is interrupted, which means that there may be a timing error (delay) near a hardware timing cycle, If there is no activation of the direct operation is also likely to be a hardware timing cycle timing error (advance), in short, this me
, ten_timer corresponding timing time minus one, if zero, then perform the corresponding function, and reset the timed time to the initial value and start the timer again. In this way, the function of multiple timers is implemented, the detailed code is as follows:
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
struct Itimerval one_timer;
struct timers
A few days ago received a project need to periodically rebuild the index task, first try the Java with the timer, do not know that it is not enough for the timer's understanding of the reasons, I feel that the timer function is a little weak, can not meet my needs: a certain period of time to be in a certain cycle to carry out the task, And these times are available for the customer to configure. Finally, t
Void timer0_isr (void) interrupt 1 using 1{Static unsigned char I; // returns the value of 12 m for Crystal Oscillator computation. The instruction period is 1 US, 500x2 = 1 ms square wave.Th0 = (65536-500)/256;Tl0 = (65536-500) % 256;I ++;P0 = I; // The P0 port outputs 8 different frequencies, which is equivalent to a divider and is frequently used as an indication wave.// Device measurement, which can be directly observed by led at low frequency// P0.0 outputs 1 ms square wave, p0.1 outputs 2
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.