// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.Timer;
import java.util.TimerTask;

public class TimerFun {
    public static void main(String[] args) throws Exception {
        Timer timer = new Timer();
        timer.schedule(new Timeout(), 5000);
        Thread.sleep(10000); // we have to wait to see the timer
        timer.cancel();
    }
}

class Timeout extends TimerTask {
    public void run() {
        System.out.println("Hej igen");
    }
}
