1 7 package measurements.suites; 8 9 import junit.framework.Test; 11 import ch.ethz.inf.util.junit.PerformanceTest; 12 import ch.ethz.inf.util.junit.PerformanceTestSuite; 13 14 22 public class CalibrationMeasurement extends PerformanceTest { 23 24 { RANGE = new int[]{20000000}; } 26 27 public void theMethodToCall() 28 { 29 int a; 30 a=1; 31 } 32 33 37 public CalibrationMeasurement(String name) 38 { 39 super(name); 40 } 41 42 45 protected void setUp() 46 { 47 } 48 49 52 protected void tearDown() 53 { 54 } 55 56 public void testVoid() 57 { 58 startChronometer(); 59 for (int i = 0; i < RUNS; i++) 60 { 61 } 62 stopChronometer(); 63 } 64 65 public void testLocalCalls() 66 { 67 startChronometer(); 68 for (int i = 0; i < RUNS; i++) 69 { 70 theMethodToCall(); 71 } 72 stopChronometer(); 73 } 74 75 79 public static Test suite() 80 { 81 return new PerformanceTestSuite(CalibrationMeasurement.class); 82 } 83 84 } 85 86 87 | Popular Tags |