Spring, Spring Boot, Spring Framework, Java, Programming.
*") // Execute every 1 second public void task1() { // Task logic goes here System.out.println("Task 1 executed."); } @Scheduled(cron = "*/5 * * * * *") // Execute every 5 second public void task2() throws InterruptedException { // Task logic goes here System.out.println("Task 2 executed.");