springboot的调度功能
@Componentpublic class ScheduledTasks {private static final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");/*** 任务调度,每隔1秒执行一次*/@Scheduled(fixedRate = 1000)public void reportCurrentTime() {System.out.println("现在时间:" + dateFormat.format(new Date()));}}
启动的时候我们必须要在主函数类上加上注解:@EnableScheduling
/*** SpringBoot使用任务调度* @EnableScheduling标注程序开启任务调度*/@SpringBootApplication@EnableSchedulingpublic class App {public static void main(String[] args) {SpringApplication.run(App.class, args);}}
quartz
https://blog.csdn.net/Alice_qixin/article/details/113802030
https://blog.csdn.net/noaman_wgs/article/details/80984873
https://blog.csdn.net/m0_45294725/article/details/102505737
