// Benchmark.java abstract class Benchmark{ abstract void benchmark(); public long repeat(int c){ long start = System.currentTimeMillis(); for (int i=0; i<c; i++) benchmark(); return(System.currentTimeMillis()-start); } } class MethodBenchmark extends Benchmark{ void benchmark(){}; public static void main(String[] args){ int c=Integer.parseInt(args[0]); long time = new MethodBenchmark().repeat(c); System.out.println(c+" methodes en "+time+" millisecondes"); } }