固定利率

如果我们想要定期执行某些操作,则会按照我们指定的毫秒值触发此代码一次:

@Component
public class MyScheduler{    
    
    @Scheduled(fixedRate=5000)
    public void doSomething() {
        // this will execute periodically
    }
}