// 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.*;

public class TimerTest {
    public static void main(String[] args) throws Exception {
        (new Timer()).scheduleAtFixedRate(new MyTimer("a"),0,1000); 
        Thread.sleep(30000);
    }
}

class MyTimer extends TimerTask {
    private String s;
    public MyTimer(String s) {
        super();
        this.s = s;
    }
    public void run() {
        System.out.println(s);
    }
}
