Guest User

Untitled

a guest
Jan 15th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. final ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(2);
  2.  
  3. final Runnable bondingTask = this::initiateBondingRound;
  4. scheduledExecutorService.scheduleAtFixedRate(bondingTask, 0, 2, TimeUnit.SECONDS);
  5.  
  6. final Runnable neighboursTask = this::initiateNeighboursRound;
  7. scheduledExecutorService.scheduleAtFixedRate(neighboursTask, 2, 1, TimeUnit.SECONDS);
Add Comment
Please, Sign In to add comment