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

public class MBM {
    public void m1() throws InterruptedException {
        Thread.sleep(1);
    }
    public void m2() throws InterruptedException {
        Thread.sleep(2);
    }
    public void m3() throws InterruptedException {
        Thread.sleep(3);
    }
    public static void main(String[] args) throws Exception {
        TimerTool.register("void MBM.m1()");
        TimerTool.register("void MBM.m3()");
        MBM o = new MBM();
        for(int i = 0; i < 1000; i++) {
            o.m1();
            o.m2();
            o.m3();
        }
        for(Map.Entry<String,Long> e : TimerTool.getAll()) {
            System.out.printf("%s : %.3f\n", e.getKey(), e.getValue() / 1000000000.0);
        }
    }
}
