简体   繁体   中英

Getting a Timer to do things at irregular intervals in java

I am trying to write a program that will fire of several events at specified yet irregular intervals. I looked at the java.util Timer class and the javax.swing Timer class, but neither of them have just what I need. I will be scheduling a lot of events, and it will take a noticeable amount of time to schedule. Therefore, t the best of my knowledge, the java.util timer won't work because it starts the timer as soon as the event is scheduled the timer starts. I need the Timer to start at the same time for all of the events, which the javax.swing timer allows you to do, but it only allows regularly spaced events. Can anyone recommend something I can do?

看一下Quartz: http//quartz-scheduler.org/,它非常灵活。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM