下面让我们来看看 spring的源代码
The JDK Timer does not offer more sophisticated scheduling
Note that Timer uses a TimerTask instance that is shared
Note that the semantics of the period vary between fixed-rate
See Timer javadoc for details on those execution modes.
说实话这个类也没什么,只是简单的包装了我们的timertask,里面也就只有几个属性,一个是时间片,一个是任务等。
真正运行我们的任务的类是:
Allows for registration of ScheduledTimerTasks, automatically starting
Note that Timer uses a TimerTask instance that is shared between
Default is "false": The timer will automatically get cancelled on
afterPropertiesSet.
这个类就是运行我们任务的类了,我们可以定制N个任务,只需要塞到这里就ok了。