springboot 定时器Scheduled


**
 * spring 自带的定时器
 */
@Component
@Configurable
@EnableScheduling  //标注启动定时任务。
public class ScheduleTask {

     @Scheduled(cron = "0 0 0 * * ?")
     public void reportCurrentByCron(){
        System.out.println("666");
     }
}



猜你喜欢

转载自blog.csdn.net/qq_37838223/article/details/80485616