package com.fdw.springbootstudy.service;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
@Service
public class ScheduledService {
//在一个特定的时间执行
//cron表达式
//秒 分 时 日 月 周几~
@Scheduled(cron = "0 15 10 * * ?")
public void hello(){
System.out.println("hello程序已经被执行了");
}
}
3.效果



