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

  • 关于我们
  • 免责声明