Guest User

Untitled

a guest
Jan 18th, 2019
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. package com.revion;
  2.  
  3. import java.util.concurrent.Executors;
  4. import java.util.concurrent.ScheduledExecutorService;
  5. import java.util.concurrent.TimeUnit;
  6.  
  7. public class ScheduleExecutor {
  8.  
  9. public static void main(String[] args) {
  10.  
  11. Runnable runnable = new Runnable() {
  12. public void run() {
  13. System.out.println("Прошло 12 дней");
  14. }
  15. };
  16.  
  17. ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor();
  18. service.scheduleAtFixedRate(runnable, 0, 12, TimeUnit.DAYS);
  19. }
  20. }
Add Comment
Please, Sign In to add comment