首页 > 编程语言 > 详细

Springboot-定时任务

时间:2020-06-16 17:11:20      阅读:54      评论:0      收藏:0      [点我收藏+]
package com.stefanie.sun.bean.TimeTest;

import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@EnableScheduling
@EnableAsync
@Component
public class TimeTest {

    @Scheduled(cron = "0 26 15 * * ?")
    public void first(){
        System.out.print("15:26定时任务已触发");
    }
}

 

Springboot-定时任务

原文:https://www.cnblogs.com/StefanieYang/p/13141183.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!