java定時任務

方法中不能有參數方法

類上加註解:@Component註解

方法上加註解@Scheduled參數

天天10:14執行:  @Scheduled(cron = "0 14 10 ? * *")

每5秒執行一次:@Scheduled(fixedRate = 5000)

相關文章
相關標籤/搜索