7778798081828384858687
timer2.schedule(new TimerTask() { @Override public void run() { LOG.log(Level.INFO, "cancel everything"); timer.cancel(); client.stop(); server.stop(); timer2.cancel(); } }, 2_000); }
7980818283848586878889
final Timer timer = new Timer("timer"); timer.schedule(new TimerTask() { @Override public void run() { timer.cancel(); client.stop(); server.stop(); } }, 200_000); }
8586878889909192939495
final Timer timer = new Timer(); timer.schedule(new TimerTask() { @Override public void run() { timer.cancel(); client.stop(); server.stop(); } }, 5_000); } }