1 package test.perf; 2 3 8 public class Foo implements FooInterface { 9 public static Object static_field = new Object (); 10 11 public static void main(String [] args) { 12 long l1 = System.currentTimeMillis(); 13 for (int i = 0; i < 100000; i++) { 14 static_method(); 15 } 16 long l2 = System.currentTimeMillis(); 17 System.out.println("Foo.main(...) executed in " + (l2-l1) + " ms"); 18 } 19 20 public static void static_method() { 21 } 22 23 public void virtual_method() { 24 } 25 } 26 | Popular Tags |