SpringBoot全局定时任务

@EnableScheduling
public class Controller extends nameController {

//定义时间间隔
@Scheduled(fixedRate=10000)
// 2.开启定时任务
private void configureTasks() {

  System.err.println("执行静态定时任务时间: " + LocalDateTime.now());

}
原文地址:https://www.cnblogs.com/h-w-b/p/15543071.html