SlowTask.java |
import java.util.*; public class SlowTask extends TimerTask { public void run() { try { // Simulation d'une tāche consommatrice de temps... Thread.sleep(5000); System.out.println("SlowTask: " + new Date()); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); } } }