logo
  • 教程列表
  • SO官方文檔
  • 任務執行和排程
    • Cron 表達
    • 啟用計劃
    • 固定延遲
    • 固定利率
  1. StackOverflow 文件
  2. spring 教程
  3. 任務執行和排程
  4. 固定延遲

固定延遲

Created: November-22, 2018

如果我們想要在執行之前定期執行一些程式碼,那麼我們應該使用固定延遲(以毫秒為單位):

@Component
public class MyScheduler{    
    
    @Scheduled(fixedDelay=5000)
    public void doSomething() {
        // this will execute periodically, after the one before finishes
    }
}
  • 固定利率
  • 啟用計劃

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明